I am trying to replace functionality we have with other charting products and am having real problems getting it to work with WinChart.
The business problem I am trying to solve is the following:
An investment portfolio is made up of instruments that come from multiple sectors. Over time the portfolio makes and/or losses money. Each of the sectors make or loose money over time as well. I need to be able to chart both the portfolio changes in value over time as well as the individual sectors.
Traditionally, this is done using a combination of line charts and bar (you call them column) charts. The lines are for the change in value of the portolio and the columns show the change in value of the sectors. So, for the line, there is one point on a day, for the sectors, there is one for each sector. With a portfolio made of three sectors, it would be a line chart with three columns for each day.
In WinChart, column charts do not seem to support date/time as an x axis at all. When implementing a composite where rather than a date we use a string, the major/minor grids for the two charts don't line up (I assume because the are fundementally different). If the labels for the chart are used from the line (the one with the dates), even if you tell the chart that the interval is one day, it shows multiple lables for the same date:
And the data points for the lines are not centered in the space taken up by the columns.
For background, this is being implemented using series and additional data streams can be overlayed onto the chart as well.
Any suggestions would be appreciated as this is a pretty basic kind of thing and I can't believe it is this hard with WinChart.
Dana
We have solved our problem by switching to a different chart control. This issue as well as complexities that the ultrachart presents when working with composite charts made working with the the control more trouble than it was worth.
We are now using the chart control included in the 4.0 framwork.
Thanks for your help.
Hello Dana,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
If the above suggestion helped you solve your issue please verify the thread as answered so other users may take better advantage of it.
Sincerely,Petar MonovDeveloper Support EngineerInfragistics Bulgariawww.infragistics.com/support
I have searching for a solution to your issue and it seems that your best option would be to align your NumericTimeSeries(Line) to your NumericSeries (ColumnDataPoints). I have spent quite some time creating a sample project in which I have used two ChartLayers in two ChartAreas. In order to compensate for the line data points start and end points I have shrunk its chart area accordingly using the column’s count and width. After dealing with this offsets it was only a matter of using axes with DataType – String so that both layers have their data points equally spread throught the axes and the chart is going to have them all aligned. Another thing you should keep an eye out is that the number of data points in your lineSeries is the same as the number of the column series.
Hope this helps. Please let me know if you require any further clarification on the matter.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
I have been looking into your requirement and think you might have misunderstood the purpose of the Column and Line charts’ labels. They are not XAxis values but are only labels. In all charts except the Scatter, ScatterLine and the Bubble the DataPoints (which support X and Y coordinates) are equally spread across the XAxis regardless of their Labels’ content. The misalignment comes from the start and end point of the two types of chart you are using. They are both equally distributed along the axis, but the Line chart starts and ends on the border of the chart’s grid area and the column data points have a little bit of offset and take more space (are wider) than the Line’s. And as a result the composite chart cannot possibly match the two’s string labels.
I have been trying to figure out a way to overcome this and have had no luck so far whatsoever. I am going to have another go at this and afterwards consult with our development team on it.
I’ll get back to you as soon as we make any progress.
Sorry for the delay, I have been out for more than a week.
I don't think you understand the issue. The column chart does not support time x axis (who knows why?), the line does. If you try to create a composite chart as I have shown in my example, when you create a column chart with the x axis as string representation of the date and a line chart with the actual date value, the items do not line up.
Your example does not represent what we are trying to do in two aspects:
I believe the issue is with combining string and time axis.