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

0
0

Hello SciChart team,

How do I serialize custom tick placement and labels, generated by TickProviderAPI and LabelProvider? Actually, the main problem is that I need to export high quality (i.e. higher than actual figure size on screen) PNG images in MVVM application and method ExportToFile(fileName, ExportType.Png, false, new Size(…, …)) produces axis ticks and labels as if they were controled by original MinorDelta and MajorDelta parameters. ExportToFile() without size parameter produces output correctly, so that must be due to not-serialized TickProvider and LabeProvider properties (?), which in exported serialized surface string does not exist.

Thank you!

Version
5.2.1.11757
  • Andrew
    Hi there! It’s difficult to say without a little bit of a code sample. Can you include some of your code snippets above so we can understand the problem better? Comment here when done so we get notified.
  • Vytautas Butkus
    Commented below
  • You must to post comments
0
0

Sure, here is the View:

<s:SciChartSurface x:Name="HeatmapSurface" RenderableSeries="{s:SeriesBinding RenderableSeries}" Background="Transparent" ChartTitle="{Binding ChartTitle}" BorderThickness="1" >
        <s:SciChartSurface.XAxis>
            <s:NumericAxis AxisTitle="{Binding XAxisTitle}" Style="{StaticResource MyThemeAxisStyle}" TickLabelStyle="{StaticResource XAxisLabelStyle}" VisibleRange="{Binding XAxisVisibleRange, NotifyOnSourceUpdated=True, Mode=TwoWay}" DrawMinorTicks="False">
            </s:NumericAxis>
        </s:SciChartSurface.XAxis>
        <s:SciChartSurface.YAxis>
            <s:NumericAxis AxisTitle="{Binding YAxisTitle}" Style="{StaticResource MyThemeAxisStyle}" TickLabelStyle="{StaticResource YAxisLabelStyle}" VisibleRange="{Binding YAxisVisibleRange, NotifyOnSourceUpdated=True, Mode=TwoWay}" TickProvider="{Binding YAxisTickProvider}" LabelProvider="{Binding YAxisLabelProvider}" AxisAlignment="Left" DrawLabels="True" IsLabelCullingEnabled="False" DrawMinorTicks="False">
            </s:NumericAxis>
        </s:SciChartSurface.YAxis>
    </s:SciChartSurface>

RenderableSeries is binding to an ObservableCollection of a single NonUniformHeatmapRenderableSeriesViewModel object in ViewModel, and objects inheriting from NumericLabelProvider (overrides string FormatLabel(IComparable dataValue)) and NumericTickProvider (overrides IList GetMajorTicks(IAxisParams axis)) are bindining to YAxis LabelProvider and TickProvider, respectively. I attach serialized surface text file and PNG exports, which I get when surface.ExportToFile(exportFileName, SciChart.Core.ExportType.Png, false, new Size(1920.0, 1920.0)) —export_resized.png— and surface.ExportToFile(exportFileName, SciChart.Core.ExportType.Png)–export_original_size.png are used.

Images
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.