Hi all,
I'm aware of how to override legend items through various examples, but all those examples are based on the fact that only one legend exists.
I'm using a composite chart to show a column and line chart, and am showing legend items for each. However I need to override the legend for the column chart (I need it to show the series labels), but leave the line legend intact.
Iterating through the primitives, I can't seem to find a way of working out which primitives apply to which legend. I thought either the layer, or chart property might give me this, but the layer always appears to be null, and the chart always appears to be 'ColumnChart'.
How can I differentiate primitives belonging to the appropriate legends?
Thanks in advance...
In the meantime....I have a workaround.
Splitting the chart width into 2 (taking into account the YAxis and Y2Axis extents, I'm aligning the LineChart legend against the Y2 Axis, setting a width to consume the chart horizontal mid-point to the Y2Axis point.
In the FillSceneGraph I capture the LineChart legend (the only one visible) - and use it's (rect.Left - rect.Width) as the new offset for a custom box of the same width and height.
I also capture the first polyLine, which is first legend item line associated with the line chart. This line's points[0].point.Y is then used as an offset to position the first new item text. For each item being added to the new legend the offset is then incremented by the labelStyle.Font.Height.
The result, ignoring my horrendous testing colour scheme, is pretty pleasing:
Not forgetting of course to set the relevant bounds for the text items in order to activate the label styling for trimming:
i don' t think there is a way to differentiate the primitives belonging to Legend A and Legend B, so your workaround is the best solution to the problem.
yes. you can also submit your feature request here: https://ko.infragistics.com/community/ideas/i/ultimate-ui-for-asp-net
I think that the ability to distinguish the items from each would be very handy, especially for scenario's like this.
Can we have this as a feature request for a future version please?