Jump to content
Software FX Community

Combination charts - aligning points and bars


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;


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

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