Hi all,
When I have a data series that there are a small range data between 2 big range data, mountain chart does not show small data until I zoom in.
Question: how can I show small data even I don’t zoom in the chart?
This is my source code:
private void SplineChartExampleView_Loaded(object sender, RoutedEventArgs e)
{
var date = DateTime.Now;
var dataSeries = new XyDataSeries<DateTime, double> { SeriesName = "Pork" };
dataSeries.Append(date, 2);
date = date.AddDays(10);
dataSeries.Append(date, 2);
date = date.AddMinutes(10);
dataSeries.Append(date, 2);
date = date.AddDays(10);
dataSeries.Append(date, 2);
dataSeries.SeriesName = "Test";
var newLineRenderableSeries1 = new FastMountainRenderableSeries()
{
StrokeThickness = 0,
RenderSize = Size.Empty,
IsHitTestVisible = true,
IsManipulationEnabled = true,
AntiAliasing = true,
LayoutTransform = Transform.Identity,
SnapsToDevicePixels = false,
DataSeries = dataSeries,
PaletteProvider = new BarPaletteProvider()
};
sciChart.RenderableSeries.Add(newLineRenderableSeries1);
sciChart.ZoomExtents();
}
public sealed class BarPaletteProvider : IFillPaletteProvider
{
public void OnBeginSeriesDraw(IRenderableSeries rSeries)
{
}
public Brush OverrideFillBrush(IRenderableSeries rSeries, int index, IPointMetadata metadata)
{
if (index == 0)
return Brushes.White;
var colorIndex = index % 5;
switch (colorIndex)
{
case 1:
return Brushes.Red;
case 2:
return Brushes.Yellow;
case 3:
return Brushes.Blue;
case 4:
return Brushes.Green;
case 5:
return Brushes.White;
}
return Brushes.Aqua;
}
}
Thanks!
- Nhan Phan asked 8 years ago
- You must login to post comments
This is not official response, but have you tried setting ResamplingMode to None on the series itself? I have had similar issues with other types of series in the past, and this resolved it for me. Basically, ResamplingMode is trying to cluster the data for you, and depending on the default implementation, the outlier is either averaged or “min/maxed” away.
It could also be that your device just isn’t able to display the line because when zoomed out, those values might calculate down to less than one pixel.
Just a couple of thoughts,
Mike.
- Michael Dusoe answered 8 years ago
-
Hi Michael, That’s a good suggestion. Another one is to use the HighQualityRenderSurface or the Direct3D10RenderSurface. Both these have sub-pixel accuracy for drawing. The default HighSpeedRenderSurface rounds all coordinates to integers, hence there can be some overdraw when pixels are rounded to nearest integer coordinate.
- You must login to post comments
Please login first to submit.