Jump to content
Software FX Community

Combination charts - aligning points and bars


rcabrera

Recommended Posts

This is just a helpful tip for those who may run into this situation.

When you are displaying a "combination" chart programmatically, of bars and lines, sometimes the line markers (dots) are not centered on the bars; instead they are aligned with the bars' left edge. 

chart.Series[0].Gallery = Gallery.Lines; chart.Series[1].Gallery = Gallery.Bar;// do data binding, etc.

Instead of doing it that way, do it this way, and the line markers will align to the centers of the bars.

chart.Gallery = Gallery.Bar;// do data binding, etc.chart.Series[0].Gallery = Gallery.Lines; chart.Series[1].Gallery = Gallery.Bar;

ChartFX_crash.zip

Link to comment
Share on other sites

It looks like you may have an extra series that you don't see (maybe because all the points are hidden).

Turn on the DataGrid to verify. By setting:

chart.Gallery = Gallery.Bar;

You are setting the default for all series to be Bar, instead of Line (default).

If I am wrong please let me know, I was unable to reproduce the behavior you described starting from a default chart.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...