SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

1
0

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?

  • You must to post comments
1
0

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:

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

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

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.