I have a chart with FastImpulseRenderableSeries.
<s:FastImpulseRenderableSeries StrokeThickness="3" SeriesColor="LawnGreen" x:Name="IdentifiedPeakSeries" YAxisId="PeakAxis">
<s:FastImpulseRenderableSeries.PointMarker>
<s:EllipsePointMarker Width="0" Height="0" Fill="LawnGreen"/>
</s:FastImpulseRenderableSeries.PointMarker>
</s:FastImpulseRenderableSeries>
The color of each Impulse depends on a own type of each result. There are three different types which should have color green, yellow and red. In the program I use the XyzDataSeries to set the x and y values of the impulse and the z-value as the type to get the color.
var seriesId2 = new XyzDataSeries<double, double, int>();
for (int i = 0; i < SamplePeakList.Count(); i++)
{
seriesId2.Append(SamplePeakList[i].Mass / 1000, SamplePeakList[i].Intensity, peakType);
}
But the IPaletteProvider has no overridable method with x, y and z value!
How can I pass the impulsetype to the palette provider to set the corresponding color?
- Michael Knitsch asked 10 years ago
- last edited 10 years ago
- You must login to post comments
Hi Michael,
The PaletteProvider feature is designed to work with X,Y values when you have an X,Y series (e.g. FastLineRenderableSeries, Impulse, Scatter). In v3.2 of SciChart there is a PaletteProvider function which accepts X,Y,Z but it is only called for FastbubbleRenderableSeries.
There are two ways to solve this problem:
-
You can use PaletteProvider with X,Y and lookup the Z value by calling XyzDataSeries.FindIndex(X), and using that index to lookup XyzDataSeries.ZValues[index]. This method will work but will be slower as each point in the series must perform an index lookup.
-
Alternatively, you can create a CustomRenderableSeries which draws a thin line up from zero to YValue and a point-marker at the YValue. You can then color the points as you wish. Please note that creating pens can be time-consuming (if StrokeThickness > 1) so its a good idea to cache them.
Do you have what you need to try this out? Please comment on my post if you need more info.
Best regards,
Andrew
- Andrew Burnett-Thompson answered 10 years ago
- You must login to post comments
Please login first to submit.