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


Updated 1/21/15 to be clearer and provide code to reproduce.

I am trying to use a custom PaletteProvider to change the color of a data point on mouse over using a hit test, so I am comparing the xValue passed into the GetColor method to the HitTestInfo.XValue and returning the updated color if they match. This works until I have data points with no color.

To replicate this issue create a FastColumnRenderable series and add the following values:

With these values the PaletteProvider GetColor method will only be called three times with X values equal to 1, 2, and 3 the expected values are 1, 3, and 5. It seems that it is returning the XValues for the first three data points instead of the first, third, and fifth data points.

Here is the example showing the problem:


 <Page x:Class="SciChartPaletteProviderBug"
    d:DesignHeight="300" d:DesignWidth="300"
Title="SciChartPaletteProviderBug" Loaded="Page_Loaded_1">

    <scichart:SciChartSurface x:Name="sciChart">
            <scichart:FastColumnRenderableSeries x:Name="columnSeries">
            <scichart:NumericAxis AxisTitle="X"></scichart:NumericAxis>
            <scichart:NumericAxis AxisTitle="Y"></scichart:NumericAxis>


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Abt.Controls.SciChart.Model.DataSeries;

namespace SciChartPaletteProviderBug
    /// <summary>
    /// Interaction logic for SciChartPaletteProviderBug.xaml
    /// </summary>
    public partial class SciChartPaletteProviderBug : Page
        public SciChartPaletteProviderBug()

        private void Page_Loaded_1(object sender, RoutedEventArgs e)
            XyDataSeries<int, int> dataSeries = new XyDataSeries<int, int>();
            dataSeries.Append(1, 1);
            dataSeries.Append(2, 0);
            dataSeries.Append(3, 2);
            dataSeries.Append(4, 0);
            dataSeries.Append(5, 3);
            using (this.sciChart.SuspendUpdates())
                this.columnSeries.DataSeries = dataSeries;
                this.columnSeries.PaletteProvider = new PointPaletteProvider();


using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Media;
using Abt.Controls.SciChart.Visuals.RenderableSeries;

namespace SciChartPaletteProviderBug
   class PointPaletteProvider : IPaletteProvider
      public Color? GetColor(IRenderableSeries series, double xValue, double yValue)
              MessageBox.Show(String.Format("X value = {0}, Y value = {1}", xValue.ToString() , yValue.ToString()));
              return null;
  • You must to post comments

Hi Steve,

My apologies for not answering this sooner, its hard to catch everything on a forum. We also have priority support for Pro/Source customers, which we have a 1-day turnaround on.

Ok, the answer to your query is that the double value is equivalent to DateTime.Ticks, so it is the x data value, not an index, but you need to transform it back to a DateTime using this code

 new DateTime((long)xValue)

The only exception is if you are using CategoryDateTimeAxis, then yes, the XValue is the index.

Are you using CategoryDateTimeAxis or DateTimeAxis? I would appreciate it if you could modify your question with a small code sample to reproduce the issue. You’ve given us some steps but its still unclear exactly how to repro.

Best regards,

  • Steve Toohey
    Updated the question with sample source code to reproduce the issue.
  • Steve Toohey
    Hi Andrew, with the updated code example are you able to reproduce the issue now?
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.