Jump to content
Software FX Community

Chart DataGrid and Showing Cumulative Data


dbeve

Recommended Posts

Hi.  We've been having great success using the Chart control on an application of ours.  Our clients like being able to look at the data directly on the chart.  Of course, they always want more.  What they would love to be able to see is the cumulative data or total for the data set somewhere on the chart. 

Example:  I might have a chart showing Sales of motorcycles vs. skidoos over time. What they would like to also see is the total number of motorcycles and skidoos sold over the whole time frame somewhere on the chart.  Not necessarily actually on the graph part but somewhere like the legend or the datagrid.  So, with that in mind, I have a couple of questions.

1.  Is it possible to modify the legend text for each line on the chart to indicate some total value along with the name of the item being charted?  ie) Motorcycles - 10,123.  How would I do this?  A simple example would be nifty.

2.  Is it possible to have data in the data grid that is not part of the chart?  How would I do this if it's possible?

Thanks for any help here.  It's appreciated.

Dave.

Link to comment
Share on other sites

> 1.  Is it possible to modify the legend text for each line on the chart to indicate some total value along with the name of the item being charted?  ie)

> Motorcycles - 10,123.  How would I do this?  A simple example would be nifty.

Yes. You can set the Series legend text to anything you want. However, the calculation of totals must be done by you.

chart.Series.Text = "Total Motorcycles $1,000,000";

> 2.  Is it possible to have data in the data grid that is not part of the chart?  How would I do this if it's possible?

No. However, what you can do is to create an additional series containing the totals, you can then make this siries invisible:

chart.Series.Visible = false;

And then tell the DataGrid to show hidden series:

chart.DataGrid.ShowHiddenSeries = true;

 

post-4744-13922403239576_thumb.gif

Link to comment
Share on other sites

Thanks for the quick response.  That helps out a ton!

Yes. You can set the Series legend text to anything you want. However, the calculation of totals must be done by you.

chart.Series.Text = "Total Motorcycles $1,000,000";

I find it interesting that when I change the series text, it also changes the datagrid series label. This would serve our purposes nicely but was hoping I could change the legend text without also changing the data grid series title.  Is that possible or are these labels essentially the same thing internally?

Dave.

Link to comment
Share on other sites

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.

Guest
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...