Jump to content
Software FX Community

Mapping rows in DataSource to entries in Chart.Points[series, point]


Recommended Posts

I am loading data into a Chart component from a dataset via Chart.DataSource and DataBind().  The dataset is actually populated in code from several other datasets, and the data successfully split into separate series, with related series grouped using panes.  That all works nicely.  I need to display additional arbitrary information in each data point's tooltip.  I have been experimenting with storing the additional information in Chart.Points[<series>, <point>].Text and modifying the ToolTipFormat to include the %L format specifier.My problem is, how do I map the data points in the dataset being used to populate the chart to their corresponding entries in the Chart.Points collection, i.e. how do I work out their series and point indices?  I seem to be able to get the right series, but the point index does not seem so straight forward.  I need to do this so that I can assign data from rows in the dataset to the correct Chart.Points[<series>, <point>].Text.  If I can crack that, the whole thing will work beautifully.Thanks in advance 

Link to comment
Share on other sites

  • 3 weeks later...

The easiest way to look at this is by seeing that each series represents a column in your table, while each point represents a row within that column. For example, if you are setting the Text property as follows, chart1.Points[0, 5].Text, then you are doing so for the first column and sixth row of the table being passed to the chart.

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...