Hello,
I have a question regarding line labels. We have a stock chart and we need to have the value/date of the line on the Y or X axis and a label. Currently (for example for HorizontalLineAnnotation), if I set:
labelPlacement to ‘Axis’ and do not set labelValue, then there is a value on the Y axis:
https://ibb.co/jrKtPzS
In the case of assigning the labelValue to ‘I would like to have text here’ and labelPlacement to Top, I get the text in the middle of the line:
https://ibb.co/N3Fq4Kk
I need a combination of these options, displaying both and, of course, changing the position as the user moves the line. We don’t have static lines, so moving a TextAnnotation assigned to a line would be troublesome (there could be a dozen of them on the chart).
https://ibb.co/Nn7cNWS
We will need this for every type of line. It would be a good solution to have, for example, 2 separate props: for the label, showLabel, labelValue, labelPlacement, and for the axis label: showAxisLabel, labelAxisValue.
Unless there is currently a way to achieve this effect?
- Kamil Macura asked 4 months ago
- last active 1 month ago
while (_CameraDataPlot.TryDequeue(out PlotData record))
{
Parallel.ForEach(record.Values, val =>
{
try
{
IRenderableSeriesViewModel render = CameraChannels
.First(x => x.ChannelId == val.Key)
.RenderableSeries
.FirstOrDefault(r => (int)(r as LineRenderableSeriesViewModel).Tag == record.Group);
if (render != null)
{
using (render.DataSeries.SuspendUpdates())
{
long ticks = record.Timestamp / 100;
(render.DataSeries as XyDataSeries<TimeSpan, double>).Append(new TimeSpan(ticks), val.Value);
}
}
}
catch (DivideByZeroException ex)
{
Console.WriteLine($"DivideByZeroException caught: {ex.Message}");
Console.WriteLine($"Timestamp: {record.Timestamp}, Value: {val.Value}");
Console.WriteLine($"Stack Trace: {ex.StackTrace}");
}
catch (Exception ex)
{
// Optional: Add logging or handling for general exceptions
}
});
}
Here is my code. When my frame rate is set to greater than 1, rendering is normal, but when I set the frame rate to less than 1, an error occurs at the “render.DataSeries as XyDataSeries<TimeSpan, double>).Append(new TimeSpan(ticks), val.Value);” position: attempting to divide by 0.
The detailed error message is as follows:
引发的异常:“System.DivideByZeroException”(位于 SciChart.Data.dll 中)
DivideByZeroException caught: 尝试除以零。
Timestamp: 2209466241, Value: 0.000170655727634525
Stack Trace: 在 puq1.nuo()
1.Add(a item)
在 puq
在 SciChart.Charting.Model.DataSeries.XyDataSeries2.Append(TX x, TY y, IPointMetadata metadata)
2.Append(TX x, TY y)
在 SciChart.Charting.Model.DataSeries.XyDataSeries
引发的异常:“System.DivideByZeroException”(位于 SciChart.Data.dll 中)
- zhang yu asked 4 months ago
- last active 2 months ago
I am using a draggable VerticalLineAnnotation to let the user select a X value. Vertical Modifier is not an option due to terrible performance. I tried with the following code but is not returning the expected value, sometimes returns a wrong value and sometimes is returning Nan:
const index = dataSeries?.findIndex(targetX, ESearchMode.Nearest);
const yValue = dataSeries?.getNativeYValues()?.get(index);
- Jhonatan Laguna asked 4 months ago
- last active 3 months ago
Hi,
I am seeing intermittent charting issues when plotting real-time data. The issue seems to be related to programmatic ranging of the x-axis, as I am unable to replicate the behavior when setting AutoRange="Always"
, and removing the programmatic ranging code.
I captured the behavior in a screen recording that can be viewed in the OneDrive link below (the file was too large to upload in this post). The behavior is replicated at time 0:00:01
. To me, it seems like the x-axis was somehow stretched in a section of the chart as the temporal distance between two consecutive data points seems to increase temporarily. In the video you can see that this behavior is transient and seems to rectify quite quickly; scrolling back to the time at which the glitch occurs, there seems to be no abnormalities in the data. The link to the video is below:
Below is the programmatic ranging method I am using:
private void AutoScaleAxes(double latestXPosition)
{
try
{
// force task to run on UI thread if not already
if (Thread.CurrentThread != _dispatcher.Thread)
{
_dispatcher.Invoke(() => AutoScaleAxes(latestXPosition));
}
else
{
var lowerBound = Math.Max(0, latestXPosition – DisplaySeconds);
if (Plots?.FirstOrDefault()?.DataSeries?.ParentSurface?.XAxes.First() is IAxis xaxis) xaxis.VisibleRange = new DoubleRange(lowerBound, latestXPosition);
var blockFirstScaling = _data.First().Count < 100; // don’t auto-scale first time until we have at least 100 data points
var autoScaleY = (_firstScaling && !blockFirstScaling) ? (!AutoScaleYAxis.HasValue) : (AutoScaleYAxis.HasValue && AutoScaleYAxis.Value);
}
}
Any thoughts on what code be causing this? Thanks!
- Jared Weyer asked 4 months ago
- last active 2 months ago
I want to display a tooltip on my scatter plot when the user hovers over a data point. However, the tooltip is getting clipped if the text is too long, even when there’s sufficient space within the chart (see attached image). Is there a way to ensure the tooltip can use the full width of the chart?
tooltipDataTemplate: (seriesInfo: SeriesInfo[]) => {
const tooltipContent: string[] = [];
seriesInfo.forEach(info => {
const metadata = info.pointMetadata as {
drift: number;
importance: number;
name: string;
weightedScore: number;
};
if (info?.isHit) {
const name = dialog ? metadata.name : metadata.name.length > 17 ? ${metadata.name.substring(0, 17)}...
: metadata.name;
tooltipContent.push(
name,
Drift: ${metadata.drift.toFixed(2)}
,
Importance: ${metadata.importance.toFixed(2)}
,
Weighted Score: ${metadata.weightedScore.toFixed(2)}
,
);
}
});
return tooltipContent;
},
I also tried to customize it using html and css, but no luck so far.
tooltipDataTemplate: (seriesInfo: SeriesInfo[]) => {
const tooltipContent: string[] = [];
seriesInfo.forEach(info => {
const metadata = info.pointMetadata as {
drift: number;
importance: number;
name: string;
weightedScore: number;
};
if (info?.isHit) {
tooltipContent.push(`
${metadata.name}
`);
}
});
return tooltipContent;
},
- Joseph Deng asked 4 months ago
- last active 3 months ago
Hi, when use dataPointWidthMode Absolute or Range and use hitTest for column, this error occurs.
im doing something wrong?
- rocket trade asked 4 months ago
- last active 3 months ago
I have one problem by printing the chart. I use one third part library for that job. This library work normally good but in this case the chart SCI will not display any curve or axis configurations.
The code .. maybe you see something.. visual is the report (UserControl) containing the chart SCI.
public static DrawingVisual BuildGraphVisual(PageMediaSize pageSize, Visual visual)
{
var drawingVisual = new DrawingVisual();
using (var drawingContext = drawingVisual.RenderOpen())
{
var visualContent = visual;
var rect = new Rect { X = 0, Y = 0, Width = pageSize.Width.Value, Height = pageSize.Height.Value };
var stretch = Stretch.None;
var visualBrush = new VisualBrush(visualContent) { Stretch = stretch };
drawingContext.DrawRectangle(visualBrush, null, rect);
drawingContext.PushOpacityMask(Brushes.White);
}
return drawingVisual;
}
- Norman Bürgi asked 4 months ago
- last active 3 months ago
We have discovered that Scichart is leaking memory on one of our machines.
Setting VisualXcceleratorEngine.IsEnabled=false prevents the memory leak.
In trying to produce a minimum reproduction I found that all I needed was a blank new WPF project with an empty SciChartSurface on it (https://grinstallers.blob.core.windows.net/public/Scichart%20Memory%20leak.zip as it would not let me attach it here).
Simply resizing the window would cause the leak. I have linked to a screen recording showing the leak occurring in real-time (https://grinstallers.blob.core.windows.net/public/Screen%20Recording%202024-11-21%20132048.mp4). The machine with the issue has an AMD Radeon RX 640 video card and I do not get the same leaking behaviour on another machine with Intel UHD Graphics 770. I have updated all drivers to the latest version and the leak still happens.
A memory dump of the process shows the majority of memory is unmanaged (Managed heap = ~450MB of 10GB).
I have gone back as far as version 8.0.0.27737 and the leaking behaviour is still there.
- Eamon asked 4 months ago
- last active 2 months ago
I found FifoCapacity Property for IDataSeries. As wrote in doc “If a value is set, when the point count reaches this value, older points will be discarded”. As I think it is very useful for real-time charts. But maybe you have the similar property (I not found it) which can set DataSeries not in dots but in bound axis values? It will be like axis length. As example, we set this value to 10 and if new added point has X coordinate between [current max X] and [current max X – 10] it will be added. Or if it more then [current max X]. And after adding all values less than [current max X – 10] will be discarded.
Or the best decision FOR ME: not delete values less than [current max X – 10] but just not display chart for them. It will be good for changing “length” property “on fly” or using zoom.
P.S. I completed decision like this to my project but now I thinking what if SciChart has it build-in?
- Fedor Iudin asked 4 months ago
- last active 4 months ago
Allow me to start with stating everything works beautifully without trying to sort my legend. See attached.
However; sorting the legend has been a problem. I created a LegendDataConverter class (IValueConverter) which felt like the appropriate method to achieve a sorted legend, but all I have managed to do is cause the Legend to stop working. I.e. an empty legend.
My SciChart instance uses a custom LegendModifier. Each series in my chart is a custom class derived from “IRenderableSeriesViewModel”, named “CustomLineRenderableSeriesViewModel”. There are several bindable properties in my derived class. These properties are used in XAML to customize the multiple series displayed.
My intent is to use those same properties in the Legend converter class to sort the items displayed in the legend. I’ve gone through several iterations of changes and have still not been successful. Here is the latest implementation, which does not provide appropriate results.
public class LegendDataConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value is ChartDataObject)
{
IEnumerable<SeriesInfo> seriesInfo = (value as ChartDataObject).SeriesInfo;
// Extract the RenderableSeries from SeriesInfo
var renderableSeries = seriesInfo.Select(si => si.RenderableSeries).OfType<IRenderableSeries>().ToList();
// Separate the series based on the custom properties
var passingLineSeries = renderableSeries.FirstOrDefault(rs =>
((CustomLineRenderableSeriesViewModel)rs.DataContext).IsPassingLine &&
((CustomLineRenderableSeriesViewModel)rs.DataContext).IsSecondAxis);
var secondaryAxisSeries = renderableSeries.FirstOrDefault(rs =>
!((CustomLineRenderableSeriesViewModel)rs.DataContext).IsPassingLine &&
((CustomLineRenderableSeriesViewModel)rs.DataContext).IsSecondAxis);
var otherSeries = renderableSeries.Where(rs =>
!((CustomLineRenderableSeriesViewModel)rs.DataContext).IsSecondAxis).ToList();
// Create the ordered list
ObservableCollection<IRenderableSeriesViewModel> ordered = new ObservableCollection<IRenderableSeriesViewModel>();
otherSeries.ForEach(s => ordered.Add((CustomLineRenderableSeriesViewModel)s.DataContext));
if (secondaryAxisSeries != null)
{
ordered.Add((CustomLineRenderableSeriesViewModel)secondaryAxisSeries.DataContext);
}
if (passingLineSeries != null)
{
ordered.Add((CustomLineRenderableSeriesViewModel)passingLineSeries.DataContext);
}
return ordered;
}
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
I welcome any suggestions.
- Chris Kirkman asked 4 months ago
- last active 4 months ago
Can I integrate the WPF charts in react code to make it web-app compatible?
- Neeraj Mirashi asked 4 months ago
- last active 4 months ago
Hello,
I have already mentioned this access violation exception in this comment:
https://www.scichart.com/questions/wpf/how-can-you-ensure-that-boxplot-series-on-different-axes-have-the-same-width
Please see the screenshot of the call stack in the comment.
This exception occurs when unloading a SciChart. The entire application crashes!
- Tobias asked 4 months ago
- last active 3 months ago
Hi,
I am using scichart for Vue.js app (with npm for version 3.5.687 ) .
Added ‘chartModifiers’ of ‘rolloverModifier’ to show tooltip when hovering above the lines.
I have multiple datasets and i only want to show one tooltip at a time for the nearest chart.
I added snapToDataPoint: true
and it doesnt do anything.
Can I get some help with that?
Thanks
- Avital Rubin asked 4 months ago
- last active 4 months ago
We are considering SciChart to our development pipeline. We need to know that SciChart is capable for plotting polar chart and Event Timeline chart. We have uploaded the images for this chart. It will very helpful if you provide sample code snippet to test. We have tested your lineChart, which is great.
Polar chart : Radius (To determine length), angle (In clockwise direction)
Event Timeline chart : Device name (left side), X-Axis=Time, Red rectangular marking indicates the time where the device is on.
- Don Shaji asked 4 months ago
- last active 4 months ago
We get this error and stack trace pretty often when clearing a large number of annotations from our CustomSourceCollectionBase. While we are using a custom collection, the call is made on a SourceCollectionBase function (Clear()). We’ve tried figuring out how to avoid this and why this happens but it appears to be something in the style of a BoxAnnotationForMvvm. Any help/guidance on this?
2024-11-06 07:46:42.545 -06:00 [Error] Exception: Cyclic reference found while evaluating the Style property on element 'SciChart.Charting.Visuals.Annotations.BoxAnnotationForMvvm'. in TimeLineViewModel
at System.Windows.FrameworkElement.UpdateStyleProperty()
at System.Windows.TreeWalkHelper.InvalidateOnTreeChange(FrameworkElement fe, FrameworkContentElement fce, DependencyObject parent, Boolean isAddOperation)
at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
at System.Windows.FrameworkElement.AddLogicalChild(Object child)
at System.Windows.Controls.UIElementCollection.AddInternal(UIElement element)
at SciChart.Core.Extensions.PanelExtensions.SafeAddChild(Panel panel, Object child, Int32 index)
at csb.rsp(IAnnotationCanvas hmb, Object hmc, Int32 hmd)
at SciChart.Charting.Visuals.Annotations.AnnotationBase.Update(ICoordinateCalculator`1 xCoordinateCalculator, ICoordinateCalculator`1 yCoordinateCalculator)
at SciChart.Charting.Visuals.Annotations.AnnotationBase.TryUpdate(ICoordinateCalculator`1 xCalc, ICoordinateCalculator`1 yCalc)
at SciChart.Charting.Visuals.Annotations.AnnotationBase.Refresh()
at SciChart.Charting.Visuals.Annotations.AnnotationBase.OnRenderablePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
at System.Windows.StyleHelper.InvalidateContainerDependents(DependencyObject container, FrugalStructList`1& exclusionContainerDependents, FrugalStructList`1& oldContainerDependents, FrugalStructList`1& newContainerDependents)
at System.Windows.StyleHelper.DoStyleInvalidations(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle)
at System.Windows.StyleHelper.UpdateStyleCache(FrameworkElement fe, FrameworkContentElement fce, Style oldStyle, Style newStyle, Style& styleCache)
at System.Windows.FrameworkElement.OnStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
at System.Windows.FrameworkElement.UpdateStyleProperty()
at System.Windows.TreeWalkHelper.InvalidateOnTreeChange(FrameworkElement fe, FrameworkContentElement fce, DependencyObject parent, Boolean isAddOperation)
at System.Windows.FrameworkElement.ChangeLogicalParent(DependencyObject newParent)
at System.Windows.FrameworkElement.RemoveLogicalChild(Object child)
at System.Windows.Controls.UIElementCollection.RemoveInternal(UIElement element)
at SciChart.Core.Extensions.PanelExtensions.SafeAddChild(Panel panel, Object child, Int32 index)
at csb.rsp(IAnnotationCanvas hmb, Object hmc, Int32 hmd)
at SciChart.Charting.Visuals.Annotations.AnnotationBase.Update(ICoordinateCalculator`1 xCoordinateCalculator, ICoordinateCalculator`1 yCoordinateCalculator)
at SciChart.Charting.Visuals.Annotations.AnnotationBase.TryUpdate(ICoordinateCalculator`1 xCalc, ICoordinateCalculator`1 yCalc)
at SciChart.Charting.Visuals.Annotations.AnnotationBase.Refresh()
at SciChart.Charting.Visuals.Annotations.AnnotationBase.OnRenderablePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
at System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
at System.Windows.Data.BindingExpression.Activate(Object item)
at System.Windows.Data.BindingExpression.HandlePropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
at System.Windows.Data.BindingExpression.OnPropertyInvalidation(DependencyObject d, DependencyPropertyChangedEventArgs args)
at System.Windows.DependentList.InvalidateDependents(DependencyObject source, DependencyPropertyChangedEventArgs sourceArgs)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at SciChart.Charting.Model.ChartSeries.SourceCollectionBase`2.ClearItems()
at Orchid.Common.UserControls.Common.CustomSourceCollectionBase`2.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args) in D:\source\Orchid\Orchid\Orchid.Common.UserControls\Common\CustomSourceCollectionBase.cs:line 72
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at DynamicData.Binding.ObservableCollectionExtended`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e) in /_/src/DynamicData/Binding/ObservableCollectionExtended.cs:line 158
at DynamicData.Binding.ObservableCollectionExtended`1.<SuspendNotifications>b__10_0() in /_/src/DynamicData/Binding/ObservableCollectionExtended.cs:line 143
at System.Reactive.Disposables.AnonymousDisposable.Dispose()
at DynamicData.Binding.ObservableCollectionAdaptor`1.Adapt(IChangeSet`1 changes) in /_/src/DynamicData/Binding/ObservableCollectionAdaptor.cs:line 67
at DynamicData.ObservableListEx.<>c__DisplayClass0_0`1.<Adapt>b__1(IChangeSet`1 changes) in /_/src/DynamicData/List/ObservableListEx.cs:line 53
at System.Reactive.Linq.ObservableImpl.Select`2.Selector._.OnNext(TSource value)
- Matthew Trahan asked 4 months ago
- last active 4 months ago
Hi ,
I am using Ternary scatter chart where in I am trying to fill each of Ellipse point marker in TernaryScatterRenderableSeries with different color using Custom palette provider inheriting IPointMarkerPaletteProvider but its not filling out with different colour, if single colour is mentioned then it fills all point single colour please do help me out whether TernaryScatterRenderableSeries supports custom palette provider or not.
Thanks
version 4.0.30319
- Namitha K asked 5 months ago
- last active 5 months ago
“I’m currently using WPF to create two curves, but why aren’t the 0 points of the two Y-axes parallel to the X-axis? Here’s my code:”
<!—->
<!–
–>
XAxisRange = new DoubleRange(0, datas[0].UNewData.Max());
LeftYAxisRange = new DoubleRange(-880, 300);
RightYAxisRange = new DoubleRange(-880, 300);
C# code
((XyDataSeries<double, double>)DataSeriesIV).Append(datas[0].UNewData, datas[0].INewData);
if (datas[0].PNewData != null)
{
((XyDataSeries<double, double>)DataSeriesPV).Append(datas[0].UNewData, datas[0].PNewData);
}
- jh jh asked 5 months ago
- last active 5 months ago
Hello,
I would like to ask if we can expect working labels for LineAnnotation anytime soon? ItÔÇÖs the only type of line that doesnÔÇÖt have functioning labels. I need this information because we are planning to deploy a version with formations soon, and we cannot afford inconsistency in the labels. If this is not planned for the near future, we will temporarily disable this option for the other lines.
Best regards,
Kamil
- Kamil Macura asked 5 months ago
- last active 2 weeks ago
Hello,
we upgraded the version from 3.4.652 to 3.5.687, and problems with the Y-axis appeared on the charts. When moving the overviewChart sliders or using the scroll wheel to change the visibleRange, the Y-axis fails to set the min and max values correctly, resulting in the default values of 0 and 10 being displayed (Error: Argument max must be a real number (not infinite, not NAN)). We didn’t change anything in the code. I checked the data we provide, and all variables are of type Number, there are no other random things.
I’ll just include the axis parameters we use.
const yAxis = new NumericAxis(wasmContext, {
autoRange: EAutoRange.Always,
growBy: new NumberRange(0.1, 0.1),
drawMajorBands: false,
drawMajorTickLines: false,
drawMinorGridLines: false,
drawMinorTickLines: false,
labelStyle: {
fontSize: 11,
fontFamily: 'Open Sans, sans-serif',
padding: new Thickness(0, 3, 0, 0),
color: this.theme.lineChartColor,
alignment: ELabelAlignment.Right,
},
maxAutoTicks: 7,
axisAlignment: EAxisAlignment.Right,
labelProvider: this.getDynamicValueLabelProvider(),
isVisible: false
});
const yAxisVolume = new NumericAxis(wasmContext, {
id: USER_CHART.Y_AXIS_VOLUME_ID,
growBy: new NumberRange(0, 4),
isVisible: false,
autoRange: EAutoRange.Always,
allowFastMath: true,
});
https://ibb.co/tL5HgCz – in the screenshot, the incorrect axes are on the left side – sometimes only the volume axis (invisible), and in another case, both axes. The correct charts are on the right side.
Best regards,
Kamil
- Kamil Macura asked 5 months ago
- last active 4 months ago
Hello there,
The hit test provider for stackedColumnRenderableSeries returns ‘false’ for the ‘isHit’ boolean when hit testing stacked columns with negative values. However, stacked Columns with positive values correctly return ‘true’ for ‘isHit’ when used in the same setup.
I am trying to achieve that the hit test provider returns ‘true’ when hit testing stacked columns with negative values.
Here’s my demo:
https://codepen.io/maxgeldner/pen/rNXYjgX?editors=1010
I have tried exchanging the series in line 75 and 77 and clicking on the displayed columns afterwards in order to hit test them. Clicking on negative columns returns ‘false’ inside the hit test, clicking on positive columns returns ‘true’.
- Johannes Pungier asked 5 months ago
- last active 4 months ago
I’m developing an EEG medical application that has a main chart displaying an interval of sampling values from a EEG recording session. In addition, there is an overview chart displaying sampling values of the entire recording session. The overview chart which is an instance of the SciChartOverview object whose x-axis is bound to the main view.
FYI: A recording sessions typically span several hours (more than 20 hours is common) and thus data-series associated to the main chart contain an interval of the recording session in order to stay within reasonable memory resources.
The application adjust’s the main view’s x-axis visible range limit & visible range size (i.e. visibleRangeLimit & visibleRangeSize) properties based on what is loaded within the main view’s data-series.
Developers that are familiar with the SciChartOverview class, know that this allows users provides users with “grips” in the chart overview allowing them to extend/contract the main axis’ visible range property.
However, the main axis’ visible range properties aren’t being enforced.
In my humble opinion, the SciChartOverview class should restrict users from setting the overview’s “grips” that conflict with the main axis’ visible range limit & visible range size properties.
I’ve review the SciChartOverview & OverviewRangeSelectionModifier class https://www.scichart.com/documentation/js/current/webframe.html#SciChartOverview.html
and there is nothing that is evident that I’ve read that gives my expected behavior of the overview.
I’d appreciate any feedback or insight on this matter before I heading down having to write customized code as to restricting the chart overview’s “grips”.
- Steven Belbin asked 5 months ago
- last active 3 months ago
The chart works ok on date data. But I have weekly data, e.g.
xValues is set to x
yValues is set to y
xl is not used for drawing the chart.
I then get a tooltip that is out of sync with the x axis (see pic).
"a": {
"x": [
1,
2,
3,
4,
5,
6,
7
],
"xl": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun"
],
"y": [
46.8235294117647,
48.0,
49.34285714285714,
45.05714285714286,
42.114285714285714,
39.55882352941177,
40.970588235294116
]
},
My chart code
const initSciChart = async(series_id, target_element_id, xValues, yValues, zoomOn = false, labels = null) =& gt; {
// Initialize SciChartSurface. Don't forget to await!
const { sciChartSurface, wasmContext } = await SciChartSurface.create(target_element_id, {
theme: new SciChartJsNavyTheme(),
title: series_id,
titleStyle: { fontSize: 22 }
});
// Create an XAxis and YAxis with growBy padding
const growBy = new NumberRange(0.1, 0.1);
let labelProvider = new SmartDateLabelProvider();
if (labels) {
console.log('setting labels');
labelProvider = new TextLabelProvider({
// When passed as an array, labels will be used in order
labels: labels,
});
}
}
const xAxesOptions = {
//axisTitle: "Time",
maxAutoTicks: 10,
minorsPerMajor: 2,
drawMajorGridLines: true,
drawMinorGridLines: true,
axisAlignment: EAxisAlignment.Bottom,
labelProvider: labelProvider,
growBy,
labelStyle: {
alignment: ELabelAlignment.Center, // Auto,
fontFamily: "Arial",
fontSize: 16,
color: "White",
}, // type TTextStyle
};
sciChartSurface.xAxes.add(new CategoryAxis(wasmContext, xAxesOptions));
sciChartSurface.yAxes.add(new NumericAxis(wasmContext, {
//axisTitle: "Counts",
axisAlignment: EAxisAlignment.Right,
autoRange: EAutoRange.Alwags,
growBy
}));
// allow zooming in the x direction
if (zoomOn) {
sciChartSurface.chartModifiers.add(
new MouseWheelZoomModifier({ xyDirection: EXyDirection.XDirection }),
new ZoomPanModifier(),
new ZoomExtentsModifier(),
);
}
// Create a line series with some initial data
let lineSeries = new FastLineRenderableSeries(wasmContext, {
stroke: "steelblue",
strokeThickness: 3,
dataSeries: new XyDataSeries(wasmContext, {
//xValues: [0,1,2,3,4,5,6,7,8,9],
//yValues: [0, 0.0998, 0.1986, 0.2955, 0.3894, 0.4794, 0.5646, 0.6442, 0.7173, 0.7833]
xValues: xValues,
yValues: yValues,
dataIsSortedInX: true,
//dataEvenlySpacedInX: true,
//containsNaN: false
}),
pointMarker: new EllipsePointMarker(wasmContext, { width: 11, height: 11, fill: "#fff" }),
});
lineSeries.rolloverModifierProps.tooltipLabelX = 'Date';
lineSeries.rolloverModifierProps.tooltipLabelY = '';
sciChartSurface.renderableSeries.add(lineSeries);
// Add RolloverModifier behavior
sciChartSurface.chartModifiers.add(new RolloverModifier());
//sciChartSurface.useCommunityLicense();
};
- Anthony Leung asked 5 months ago
- last active 4 months ago
Hello,
we have a problem with the values on the Y-axis. We use autoRange: EAutoRange.Always, so in theory, the candles and lines should always be visible. The problem occurs when we have 1 candle or 1 OHLC and with the line chart when a new value goes beyond the current range – the value axis update only happens after the second new record. Below I am attaching the code we use; maybe something is missing or incorrect.
//create axis
const yAxis = new NumericAxis(wasmContext, {
autoRange: EAutoRange.Always,
growBy: new NumberRange(0.1, 0.1),
drawMajorBands: false,
drawMajorTickLines: false,
drawMinorGridLines: false,
drawMinorTickLines: false,
labelStyle: {
fontSize: 11,
fontFamily: 'Open Sans, sans-serif',
padding: new Thickness(0, 3, 0, 0),
color: this.theme.lineChartColor,
alignment: ELabelAlignment.Right,
},
maxAutoTicks: 7,
axisAlignment: EAxisAlignment.Right,
labelProvider: this.getDynamicValueLabelProvider(),
});
const yAxisVolume = new NumericAxis(wasmContext, {
id: USER_CHART.Y_AXIS_VOLUME_ID,
growBy: new NumberRange(0, 4),
isVisible: false,
autoRange: EAutoRange.Always,
allowFastMath: true,
});
//create
this.getCandleSeries().dataSeries.append(this.xValues.length - 1, open, high, low, close);
//update
const currentIndex = this.getCandleSeries().dataSeries.count() - 1;
this.getCandleSeries().dataSeries.update(currentIndex, open, high, low, close);
Current view – https://ibb.co/BtCzdgS
Desired view – https://ibb.co/TknZQXG
Line – https://ibb.co/PxY0n3t – also the price annotation is invisible because the new value is out of the current range
If any other part of the code is needed, let me know.
Best regards,
Kamil
- Kamil Macura asked 5 months ago
- last active 5 months ago
Hi,
would it be possible for the onDrag function to return the same values as onClick, namely sender, mouseArgs, and relativeCoords (although I won’t need the latter)? Currently, it doesn’t return anything.
Best regards,
Kamil
- Kamil Macura asked 5 months ago
- last active 2 months ago
Memory Leak and Crash In SciChart 3D
Demo: https://github.com/Chenyliang/CrashDemo
The situation occurs in two configurations.
1、 i7-9700 + Graphics card: Intel(R) UHD Graphics 630
2、i7-12700 + RTX 3050
Version : 8.5.0.28148
- chen yl asked 5 months ago
- last active 5 months ago
Hi there.
I want to handle the double-click event axis in a 3D chart.
Here is my code.
<s3D:SciChart3DSurface x:Name="chartSurface">
<s3D:SciChart3DSurface.YAxis>
<s3D:NumericAxis3D MouseDoubleClick="Axis_MouseDoubleClick" />
</s3D:SciChart3DSurface.YAxis>
</s3D:SciChart3DSurface>
private void Axis_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
//Do something for target axis...
}
but, it doesn’t seem to work.
So I tried to get the Hit object using “VisualTreeHelper.HitTest”, but it also didn’t work.
protected override void OnMouseDoubleClick(MouseButtonEventArgs e)
{
var hitResult = VisualTreeHelper.HitTest(chartSurface, e.GetPosition(this));
var axis = FindParent<NumericAxis3D>(hitResult.VisualHit);
if (axis != null)
{
//Do somthing for target axis...
}
base.OnMouseDoubleClick(e);
}
private static T? FindParent<T>(DependencyObject child) where T : DependencyObject
{
if (child == null) return null;
T? foundParent = null;
var currentParent = VisualTreeHelper.GetParent(child);
do
{
if (currentParent is T)
{
foundParent = (T)currentParent;
break;
}
currentParent = VisualTreeHelper.GetParent(currentParent);
} while (currentParent != null);
return foundParent;
}
It seems to work well in 2D charts.
Can you please tell me the way to handle the mouse event for the axes in a 3d chart?
Thanks.
- nada nada asked 5 months ago
- last active 2 months ago
Dear SciChart Team,
I am currently using CursorModifier.tooltipDataTemplate with FastBubbleRenderableSeries. In my DataSeries, I have two or more data points that share the same xValues and yValues. However, the SeriesInfo only returns one of these data points, and I am unable to retrieve the others to add them to the lineItems.
Do you have any suggestions on how to solve this?
Thanks in advance!
Best regards,
Phat Pham
- Pham Phat asked 5 months ago
- last active 5 months ago
I’ve created a chart with a FastColumnRenderableSeries and a logarithmic Y-axis with a VisibleRange of min=1e-13, max=1e-7. However the resulting chart appears “upside down”, which I understand is a consequence of plotting values <1. Is there any way to “correct” this?
Plotting my data in Excel initially exhibits the same “upside down” behaviour, but can be corrected by setting the “Horizontal access crosses” axis option to 1e-13, so is there an equivalent setting in SciChart? I thought it might have been the ZeroLineY property, but playing around with this had no effect.
As a cheat/workaround I’ve switched to a FastLineRenderableSeries, as you don’t see the upside down effect, but the preference is for a column chart. (I’m rewriting a very old app that uses Dundas, and this does somehow render the data the “right way up”, so I know customers are going to want a like-for-like bar chart).
- Andrew Stephens asked 5 months ago
- last active 5 months ago
Is is possible to generate a Constellation diagram (Quadrant chart with circle shape) using SciChart?
If it is possible, please share a sample project.
- Tripti Asawa asked 5 months ago
- last active 5 months ago
Hello,
The chart has a Y-axis on both the right and left sides, representing price and volume respectively. I would like both labels with the current values (HorizontalLineAnnotation) to be on the right Y-axis. When using yAxisId and horizontalAnchorPoint: “Right,” the volume label (left axis) appears inside the chart. Is there any way to move it to the right Y-axis? I tried using TextAnnotation instead of HorizontalLineAnnotation, and the only way to get the label to appear above the Y-axis on the right side was by using xCoordinateMode: ‘Pixel,’ but I don’t know if there’s any way to get the height in pixels for the current volume value from the left axis.
Best regards,
Kamil
- Kamil Macura asked 5 months ago
- last active 5 months ago
Is there a simple way to change the order that a number FastLineRenderableSeries are drawn on the graph surface?
We want to be able to change the order in some other part of our program and have the graph update to reflect that change.
Thanks
- Andrew Milford asked 5 months ago
- last active 5 months ago
I have a line chart and I frequently notice the lines were rendered with gaps in random places that change in size as the chart is being scrolled in the horizontal direction. Please see the attached screenshot/video.
The location of the gap seem to be different every time the page is reloaded.
I do have the following configuration, however I’ve observed the behaviour without the configuration as well.
new XyDataSeries(wasmContext, {
dataIsSortedInX: false,
dataEvenlySpacedInX: false,
containsNaN: true,
});
Appreciate any pointers on how to resolve this issue.
- Edwin Liu asked 5 months ago
- last active 5 months ago
It is unable to add a horizontal line to the polar graph, but I need to make a circle, which in essence will be a horizontal line, is it possible to add it somehow or draw this circle in some other way.
The picture shows how it should look (here the circle was made with FastLineRenderableSeries)
- Alex Demenev asked 6 months ago
- last active 4 months ago
Hello,
I noticed a problem where the tooltip in 3D charts does not work on new data.
Below I have a simple example where the tooltip works as expected on the initial data but does not show when hovered over the data added in the interval via the appendRange function.
https://codesandbox.io/p/sandbox/3d-bubble-chart-forked-vd8ngd
Is there a problem or something missing with my implementation of the tooltip?
- Yiğit Arısoy asked 6 months ago
- last active 6 months ago
I am added Relative Annotations but look like it worked only for X axis. Why if Y1=0.5 it not displayed only on half of chart? What I done wrong?
- Fedor Iudin asked 6 months ago
- last active 5 months ago
Is there a javascript version for ColumnRenderableSeries3D? im trying to recreate this wpf scichart into javascript.
- Jefferson Rosimo asked 6 months ago
- last active 5 months ago
Dear SciChart Team,
I am attempting to create a custom PaletteProvider for PointMarker that does not trigger each time the visible range changes. I have referred to the documentation here: https://www.scichart.com/documentation/js/current/typedoc/interfaces/ipointmarkerpaletteprovider.html.
I have implemented the new class as follows:
class NewTradePaletteProvider {
constructor(inputChart) {
this.inputChart = inputChart;
}
onAttached(parentSeries) {
this.parentSeries = parentSeries;
}
onDetached() {
this.parentSeries = undefined;
}
get isRangeIndependant() {
return true;
}
overridePointMarkerArgb(xValue, yValue, index, opacity, metadata) {
const fillValue =
index % 2 == 0
? parseColorToUIntArgb("#00AB55")
: parseColorToUIntArgb("#2195F2");
return { stroke: undefined, fill: fillValue };
}
}
However, the overridePointMarkerArgb method is still being called every time the visible range changes. Could you kindly advise if there is an issue with my approach?
Best regards,
Phat
- Pham Phat asked 6 months ago
- last active 6 months ago
Hello,
I wanted to move the displayed data away from the Y-axis because the annotations were not fitting. So I set overrideOffset: -14 on the X-axis (CategoryAxis). The data moved, but now the labels on the X-axis are not centered, so I set on the X-axis labelStyle: {padding: new Thickness(2, 36, 0, 0)}. The labels are centered, but now the labels from CursorModifier are shifted. Is there any way to move them? I would like to have all the labels centered. I couldn’t find any properties to change the padding – the only changes available are color changes. Unless there is another method to move the data series away from the Y-axis instead of using overrideOffset.
Best regards,
Kamil
- Kamil Macura asked 6 months ago
- last active 5 months ago
Hello
I am trying to make visual E2E test form my application with playwright
When running locally everything works as expected after opening scichart’s Licence Wizard
But when I try to enter same page with playwright I get license key error
Is there any way to solve this? How excatly does scichart check for licence key?
I would be very glad for some help with this
- Cezary Szymanski asked 6 months ago
- last active 6 months ago
I have this x axis:
private fun createxAxis(builder: SciChartBuilder, firstDay: Date?): DateAxis {
val weekAgo = Calendar.getInstance().let {
it.time = Date()
it.add(Calendar.DATE, -6)
it.time
}
val today = Calendar.getInstance().let {
it.time = Date()
it.add(Calendar.DATE, 1)
it.time
}
val historicalFirst = if (firstDay != null) {
Calendar.getInstance().let {
it.time = firstDay
it.add(Calendar.DAY_OF_MONTH, -1)
it.time
}
} else {
weekAgo
}
return builder.newDateAxis().apply {
withDrawLabels(true)
withDrawMajorBands(false)
withDrawMajorTicks(false)
withDrawMinorTicks(false)
withTextFormatting("E")
withTickLabelStyle(
FontStyle(
ResourcesCompat.getFont(context, R.font.proxima_nova_400),
context.resources.getDimension(R.dimen._9sdp),
resources.getColor(R.color.white, null),
true
)
)
withAutoFitMarginalLabels(false)
withDrawMajorGridLines(true)
withDrawMinorGridLines(false)
isEnabled = true
withVisibleRange(weekAgo, today)
withVisibleRangeLimit(historicalFirst, today)
}.build()
}
and this pan modifier:
private class CustomXAxisDragModifier(
val gestureCallback: WeakReference
) : XAxisDragModifier() {
override fun performPan(xDelta: Float, yDelta: Float, isSecondHalf: Boolean, axis: IAxis) {
super.performPan(xDelta, yDelta, isSecondHalf, axis)
when (axis) {
is DateAxis -> {
gestureCallback.get()
?.onVisibleRangeUpdated(axis.visibleRange.min, axis.visibleRange.max)
}
}
}
}
val panModifier = CustomXAxisDragModifier(WeakReference(callback)).apply {
dragMode = AxisDragModifierBase.AxisDragMode.Pan
minTouchArea = 1000.0f
clipModeX = ClipMode.ClipAtExtents
clipModeTargetX = ClipModeTarget.VisibleRangeLimit
}
surface.chartModifiers.add(panModifier)
When I load this chart with data, it looks correct (see first screenshot). But the moment I try to drag it, the chart clips to the most recent data point (see second screenshot) instead of what I’m setting as the visible range limit. The most recent data point is a few days before today. How can I get the panning to clip at the visible range limit?
- Marcela Guerra asked 6 months ago
- last active 2 months ago
Hello SciChart Team,
I am currently working with FastBubbleRenderableSeries
using XyzDataSeries
, and I’ve encountered an issue where multiple elements in my dataset share the same X, Y, and Z values. To differentiate them, I need to assign a unique unique_id
via the PointMetaData
API.
Is there an efficient way to retrieve the indices of elements that correspond to a specific unique_id
? I have explored the documentation (https://www.scichart.com/documentation/js/current/typedoc/classes/xyzdataseries.html) but couldn’t find relevant information.
Any suggestions or alternative approaches would be greatly appreciated!
Best regards,
Phat
- Pham Phat asked 6 months ago
- last active 6 months ago
I have a chart with a CategoryDateTimeAxis x-axis, some of the data points that have the same date can’t be selected, and I noticed if I add points that have a different date, the selection works as expected.
It seems that the DataPointSelectionModifier.SelectionChanged even is fired but the DataPointSelectionModifier.SelectedPointMarkers collection is empty
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
// Create the X and Y Axis
var xAxis = new CategoryDateTimeAxis() { AxisTitle = "Date", TextFormatting = "dd/MM/yyyy" };
var yAxis = new NumericAxis() { AxisTitle = "Value" };
var selectionModifier = new DataPointSelectionModifier()
{
ReceiveHandledEvents = true,
AllowsMultiSelection = false,
ExecuteOn = ExecuteOn.MouseLeftButton,
UseLayoutRounding = true
};
selectionModifier.SelectionChanged += SelectionModifier_SelectionChanged;
SciChartSurface.XAxis = xAxis;
SciChartSurface.YAxis = yAxis;
SciChartSurface.ChartModifier = new ModifierGroup(
new RubberBandXyZoomModifier(),
new ZoomExtentsModifier(),
selectionModifier);
var series = new XyDataSeries<DateTime, double>();
for (int i = 0; i < 20; i++)
{
var date = i < 10 ? DateTime.Now.AddDays(i) : DateTime.Now.AddDays(10);
series.Append(date, i, new SelectedPointMetadata());
}
var renderableSeries = new FastLineRenderableSeries()
{
DataSeries = series,
XAxis = xAxis,
YAxis = yAxis,
PointMarker = new EllipsePointMarker() { Width = 10, Height = 10, Fill = Colors.Red },
SelectedPointMarker = new EllipsePointMarker() { Width = 10, Height = 10, Fill = Colors.Green },
};
SciChartSurface.RenderableSeries.Add(renderableSeries);
}
private void SelectionModifier_SelectionChanged(object? sender, EventArgs e)
{
if (sender is not DataPointSelectionModifier dataPointSelectionModifier)
{
return;
}
var dataPointInfo = dataPointSelectionModifier.SelectedPointMarkers.FirstOrDefault();
if (dataPointInfo is null)
{
return;
}
var metaData = dataPointInfo.DataPointMetadata as SelectedPointMetadata;
}
}
public class SelectedPointMetadata : IPointMetadata
{
public event PropertyChangedEventHandler PropertyChanged;
public bool IsSelected { get; set; }
}
- Mohamed Ben Amar asked 6 months ago
- last active 6 months ago
I’m modifying the https://demo.scichart.com/javascript/multi-pane-stock-charts-sync-technique# example. To the right of the OHLCV chart I would like to plot GEX levels (a ladder plot) which is unique for every date, and which should update as I scroll across the X-axis of the OHLCV chart. However, I’m unable to write an event listener to make this happen.
- Marital Weeping asked 6 months ago
- last active 6 months ago
I’m apart of a team that has applications written in wpf. We’re looking at switching frameworks to use Flutter and Dart instead. We all really like using scicharts for the performance and all of the graphing features that are available. Is there plans in the future to support flutter and dart or is there a workaround to currently do this?
- Anthony Eshleman asked 6 months ago
- last active 2 months ago
Is there a way to override the shape of each individual PointMarker within the same series based on the metadata? I can override the color of individual points in the DefaultPaletteProvider, but I haven’t found a solution for the shape.
- Son Tran asked 6 months ago
- last active 6 months ago
Hello SciChart Team,
Problem description:
I have a main stock chart and I can add various indicators to it, some of which appear below it as new charts. Additionally, I can draw different types of lines on both the indicators and the chart. If I draw a line on each of them, I can select each one in turn and end up with all three lines selected, but I need to have only one selected and its ID saved (to open the editor and be able to edit its parameters). Is there any way to connect the charts so that the lines “see each other” and deselect when another is selected? Unfortunately, selectedChanged.subscribe doesn’t work because I don’t receive false from other charts.
Best regards,
Kamil
- Kamil Macura asked 6 months ago
- last active 6 months ago
Any update on ARM support?
Not asking about MacOS/linux but Windows on ARM.
- Eamon asked 6 months ago
- last active 6 months ago