I tried to apply offset on the data in a live updating multiple lines chart. But it doesn’t work for me. Below are my codes for adding trace and updating data:
Add a trace to the chart without data in the beginning:
const xyDataSeries = new XyDataSeries(wasmContext);
const offsetFilter = new XyScaleOffsetFilter(xyDataSeries, { scale: 1, offset: 50 });
let trace1 = new FastLineRenderableSeries(wasmContext, {
type: ESeriesType.LineSeries,
id: 1,
stroke: #333,
strokeThickness: 1,
dataIsSortedInX: true,
dataEvenlySpacedInX: true,
containsNaN: false,
dataSeries: offsetFilter,
});
sciChartSurface.renderableSeries.add(trace1);
Update chart data later:
sciChartSurface.renderableSeries.items.forEach(serie => {
serie.dataSeries.clear();
serie.dataSeries.appendRange(dataX, dataY);
});
I can’t see the offset 50 applied on the chart data. Not sure what’s wrong with my codes.
- Quyen Sy asked 1 year ago
- last active 1 year ago
I am using the 2D Heatmap with text as my working prototype. I wish to have a secondary Axis on the opposite side of my man Axis that displays a count for that row or column. To display this information is simple enough through using the LabelProvider (although two lines maybe a bit tricky), and I can do some stuff with the TickProvider when it gets a bit too busy.
My question is on how I can position these TickLabels to be in the center of a row/column?
My first thought was I could be cheeky and set the margin value to offset it in its style but it seems it only works so far with the TickLabel just displayed below the tick.
<Style x:Key="LeftAxisLabelStyle" TargetType="s:NumericTickLabel">
<Setter Property="Margin" Value="0,0,0,-30"/>
</Style>
What I am trying to achieve seems to be the default positioning for column charts, and histograms. I was wondering if there is a behind the scenes option or an override I’ve missed to set this?
Alternatively annotations maybe the way to go but I get the impression that this is more for on chart labels rather than for Axis?
p.s. I think when dealing with multiple Axes, you should give an warning/error if an “Id” is not given to secondary Axis as the graph will just show blank.
- Matthew Bristow asked 7 years ago
- last active 7 years ago
I use a simple box annotation to highlight a section candlesticks on a chart. Currently I only see how to set this annotation X1 and X2 to Major grid units (ie 1,2,3,4,5). Since I would like to have this box annotation fully highlight only the desired candlesticks, is there a way to offset this X1 and X2 position by 0.5 so that it would include only (and fully) the desired candles? Apologies if I have missed this in the docs somewhere but I have been unable to find anything to accomplish this.
EDIT: For my x axis I am using a CategoryDateTimeAxis
Thank you.
- Leland asked 4 years ago
- last active 4 years ago