Ask a questionAsk a question
 

AnswerPointWidth - retrieving

  • Wednesday, November 04, 2009 9:57 AMAlvy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi guys!

    I'm putting together a charting utility class to help me with an analytics projec I'm putting together. One of the requirements of this project is the ability to combine bar charts with Point charts, which unfortunately is something that cannot be combined in Microsoft's Chart implementation. The idea of the final graph looks like this:

    http://www.haushinka.org/media/example_graph.jpg

    However, all is not lost. I have been using the PostPaint event to draw some of the custom point chart areas (e.g. "competitor" and "projection" points) manually using GDI. Everything's been fairly easy in terms of retrieving coordinates for each point in the data series, but I'm struggling on one part of it.

    I want to draw the points the same width as the bar charts themselves. Having read over this forum, I see lots of mentions of manually setting the PointWidth or PixelPointWidth custom property to define the fixed width of each bar in the series, but I see no mention of a way to retrieve the width in pixels or as using the charting coordinate system, without having to first set the width manually using the previously mentioned custom properties.

    Is this is a limitation of the charting component? Is there no way of simply retrieving the currently rendered bar width properties without first fixing it manually?

    Any comments or pointers would be appreciated.


    Many thanks,
    Alvaro

Answers

  • Wednesday, November 04, 2009 10:51 AMsipla Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hello,

    I just wanted to point out that you can combine any chart types by adding a chart area (or areas) on top of the other, setting the background of the area on top transparent, and setting the axis limits if needed.

    I've used this method on several charts and it seems to work well enough. Though I admit that for some of them the Post- or PrePaint methods might be a more suitable solution.

    Here is a thread with an example I posted. (without reading the title properly)

    ..I don't have an answer to your question though, sorry. :)

All Replies

  • Wednesday, November 04, 2009 10:51 AMsipla Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Hello,

    I just wanted to point out that you can combine any chart types by adding a chart area (or areas) on top of the other, setting the background of the area on top transparent, and setting the axis limits if needed.

    I've used this method on several charts and it seems to work well enough. Though I admit that for some of them the Post- or PrePaint methods might be a more suitable solution.

    Here is a thread with an example I posted. (without reading the title properly)

    ..I don't have an answer to your question though, sorry. :)
  • Wednesday, November 04, 2009 11:07 AMAlvy Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Hi Sipla,

    Many thanks for that - I came across that posting and pondered about the possible problems with using such a method. I may put together a test project to see how that kind of data can come across using your method.

    Many thanks!


    Alvaro