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));
- Michel Bieleveld asked 8 years ago
- last edited 8 years ago
-
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 login to post comments
Now with attachment and an image showing the weird bars.
- Michel Bieleveld answered 8 years ago
- last edited 8 years ago
-
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 login to post comments
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…
- Michel Bieleveld answered 8 years ago
- last edited 8 years ago
-
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 login to post comments
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>
- Michel Bieleveld answered 8 years ago
- last edited 8 years ago
- You must login to post comments
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
- Andrew Burnett-Thompson answered 8 years ago
- You must login to post comments
Please login first to submit.