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

Dear all, I am trying to export a heat map that I have generated that you can see at the right side of the attached image. However, the resulting XPS generated is the figure at the left. As one can see they are not very similar as one would expect. I have checked my code, but can’t seem to find the problem. Parts of my code are shown here to give more info. If anyone has tips why this strange result may occur , let me know please.

 <s:SciChartSurface x:Name="sciChart"  ChartTitle="Carbon and DBE">


       <s:SciChartSurface.RenderableSeries>
           <s:FastHeatMapRenderableSeries x:Name="heatmapSeries" Opacity="0.5" Maximum="100">
               <s:FastHeatMapRenderableSeries.ColorMap>
                   <LinearGradientBrush>
                       <GradientStop Offset="0" Color="DarkBlue"/>
                       <GradientStop Offset="0.2" Color="CornflowerBlue"/>
                       <GradientStop Offset="0.4" Color="DarkGreen"/>
                       <GradientStop Offset="0.6" Color="Chartreuse"/>
                       <GradientStop Offset="0.8" Color="Yellow"/>
                       <GradientStop Offset="1" Color="Red"/>
                   </LinearGradientBrush>
               </s:FastHeatMapRenderableSeries.ColorMap>
           </s:FastHeatMapRenderableSeries>

       </s:SciChartSurface.RenderableSeries> .
    </s:SciChartSurface>

and code

    double[,] a = x.Normalized2DArray(100);
                    Heatmap2DArrayDataSeries<double, double, double> heatmap = new Heatmap2DArrayDataSeries<double, double, double>(a, ix => (double)ix * x.binSizeX, iy => (double)iy * x.binSizeY);
                      heatmapSeries.DataSeries = heatmap;
          sciChart.ExportToFile(@"C:\Temp\chart.xps", ExportType.Xps, true, new Size(2000, 2000));
Version
latest from nuget
Images
  • Michel Bieleveld
    I have changed my render surface to xaml and the image is similar to the left with the same data. In my data I can’t find a reason why that weird vertical bar is there, it is not present in the a[,] array mentioned in the above code.
  • You must to post comments
1
0

Now with attachment and an image showing the weird bars.

Images
  • Andrew
    Wierdly, I can’t reproduce this with v4.2.0.8826 (which is the version your sample appears to be targetting). I am still trying ..
  • You must to post comments
0
0

Another thing I noticed that all xps images of the heatmap are vertically mirrored. Easy to check by modifying the heatmap example solution with the following change;

    private void TimerOnTick(object sender, EventArgs eventArgs)
    {
        _timerIndex++;
        Random r = new Random();
        sciChart.ExportToFile(String.Format(@"C:\Temp\chart{0}.xps",r.Next()), Core.ExportType.Xps, true);
        //heatmapSeries.DataSeries = _dataSeries[_timerIndex % _dataSeries.Count];
    } 

The axis are correct but the shown data is not. My quest for a solution continues…

  • Andrew
    Wierdly I can’t reproduce this either. I tried to set the data[y,x] = y == 0 ? 20.0 : 0.0. This paints a thin line at the bottom of the chart (where Y=0). Do the same for x == 0 and it paints a thin line on the left as expected.
  • You must to post comments
0
0

Okay I have found the problem and it is reproducible. For some reason if the control is within a grid it goes wrong. See the attached projects MainWindow. When the Grids’ row and column definitions are commented out everything goes well (although the image is vertically mirrored) but when the definitions are present the image has strange bars like in the above images and the colors are off. Any ideas what is causing this ? (Ps. Fixed sizes don’t have the problem too).

 <Grid>

         <Grid.RowDefinitions>
             <RowDefinition Height="*"/>
             <RowDefinition Height="*"/>
         </Grid.RowDefinitions>
         <Grid.ColumnDefinitions>
             <ColumnDefinition Width="*"/>
             <ColumnDefinition Width="*"/>
         </Grid.ColumnDefinitions>

         <example:HeatMapExampleView Grid.Column="1" Grid.Row="1" />
 </Grid>
  • You must to post comments
0
0

I’m sorry, I cannot reproduce the bars issue using your sample.

I added a video to youtube to show our testing and the result with version v4.2.0.8826.

I did however reproduce the vertically mirrored problem when exporting with useXamlRenderSurface=true. We will investigate this.

Best regards,
Andrew

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.