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

0
0

Hi,

InvalidatateParentSurface does’t seem to update the text in the heatmap cell however the change seems to be detected and the color value is getting updated. Can you please suggest how to fix this?

Attached is a sample.

Thanks,
-Tom

Version
4.2.3.10185
  • You must to post comments
0
0

Hi there,

i’m going to investigate this, and check your sample, going to be back soon with results

  • You must to post comments
0
0

Hi mijothomas,

I’ve investigated your app and it seems that the values of DataSeries were not changed, that is why text shows without changes you can see in your tooltips, still investigating the reason of this.

  • You must to post comments
0
0

Hi there,

I’ve found solution for you: in your TimerOnTick() you have to set your new value to the propper cell in real 2DArray to get text updated

[1] var values = ((IHeatmap2DArrayDataSeries)heatmapSeries.DataSeries).GetArray2D(); — this will return you a real collection
[2] values[YAxis, XAxis] = newValue; — this will set your new value to the collection;

private void TimerOnTick(object sender, EventArgs eventArgs)
    {
        var randomX = _random.Next(0, HeatMapDimensions.AxisXMax+1);
        var randomY = _random.Next(0, HeatMapDimensions.AxisYMax+1);

        for (int YAxis = 0; YAxis < randomY; YAxis++)
        {
            for (int XAxis = 0; XAxis < randomX; XAxis++)
            {
                var newValue = _random.NextDouble() * 100d;
                var oldValue = _array[YAxis, XAxis];
                _array[YAxis, XAxis] = newValue;

                // Solution
                var values = ((IHeatmap2DArrayDataSeries)heatmapSeries.DataSeries).GetArray2D();
                values[YAxis, XAxis] = newValue;
                // End of Solution

                System.Diagnostics.Debug.WriteLine($"Old Value {oldValue} at [{YAxis},{XAxis}] updated to {newValue}");
                _viewModel.SetMax(newValue);
                _viewModel.SetMin(newValue);
                _metaDataContainer.Update(YAxis, XAxis, newValue, _viewModel.Min, _viewModel.Max);

            }
        }
        heatmapSeries.DataSeries.InvalidateParentSurface(RangeMode.ZoomToFit);
    }
  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.