Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Show position of a chartingToolkit:LineDataPoint in a collection

Show position of a chartingToolkit:LineDataPoint in a collection

Scheduled Pinned Locked Moved WPF
wpfquestioncsharpcssdatabase
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    surfluds
    wrote on last edited by
    #1

    I have set up the following tooltip to show the x and y values of datapoints within a WPF linechart, what I would also like to do is show the index within the collection that the point uses. How do I show this please?

    <Style x:Key="ToolTipDataPointStyle" TargetType="chartingToolkit:LineDataPoint">
    <Setter Property="Background" Value="Green"/>
    <Setter Property="Template">
    <Setter.Value>
    <ControlTemplate TargetType="chartingToolkit:LineDataPoint">
    <Grid x:Name="Root" Opacity="1">
    <ToolTipService.ToolTip>
    <StackPanel Margin="2,2,2,2">
    <ContentControl Content="{Binding HoleSize}" ContentStringFormat="Hole Size: {0}" />
    <ContentControl Content="{Binding PulseWidth}" ContentStringFormat="Pulse Width: {0}"/>
    <!--<ContentControl Content="{Binding Path.[0]}" ContentStringFormat="Data = {0}"/>-->
    </StackPanel>
    </ToolTipService.ToolTip>
    <Ellipse StrokeThickness="{TemplateBinding BorderThickness}" Stroke="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}"/>
    </Grid>
    </ControlTemplate>
    </Setter.Value>
    </Setter>
    </Style>

    P 1 Reply Last reply
    0
    • S surfluds

      I have set up the following tooltip to show the x and y values of datapoints within a WPF linechart, what I would also like to do is show the index within the collection that the point uses. How do I show this please?

      <Style x:Key="ToolTipDataPointStyle" TargetType="chartingToolkit:LineDataPoint">
      <Setter Property="Background" Value="Green"/>
      <Setter Property="Template">
      <Setter.Value>
      <ControlTemplate TargetType="chartingToolkit:LineDataPoint">
      <Grid x:Name="Root" Opacity="1">
      <ToolTipService.ToolTip>
      <StackPanel Margin="2,2,2,2">
      <ContentControl Content="{Binding HoleSize}" ContentStringFormat="Hole Size: {0}" />
      <ContentControl Content="{Binding PulseWidth}" ContentStringFormat="Pulse Width: {0}"/>
      <!--<ContentControl Content="{Binding Path.[0]}" ContentStringFormat="Data = {0}"/>-->
      </StackPanel>
      </ToolTipService.ToolTip>
      <Ellipse StrokeThickness="{TemplateBinding BorderThickness}" Stroke="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}"/>
      </Grid>
      </ControlTemplate>
      </Setter.Value>
      </Setter>
      </Style>

      P Offline
      P Offline
      PumbaPumba
      wrote on last edited by
      #2

      Hi surfluds, May be this link could help you. http://endofstream.com/charts-creating-custom-style-for-linedatapoint/

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups