Pre loader

Forums

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0 votes
6k views

Hello everyone.
We are trying to migrate to V3 in our iOS project and we have many issues.
One of the most important is the implementation of vertically-draggable horizontal lines.
I have a nice working code for SCICharts V2 but I cannot find any similar example of how we can implement a custom modifier for moving an SCIHorizontalLineAnnotation vertically in V3.
We have done it already with the V2 but now that we have to migrate to V3 there is a huge missing part in your documentation.
Our code was using-overiding onPanGesture() in order to figure out if the modifier should handle the touching event, then we were using the touch point in order to find the closer horizontal lines and choose the closest one in order to change the vertical value depending on the touching-changing point.
The only similar example that I found in your documentation (https://www.scichart.com/example/ios-custom-modifier/) is using SCIGestureModifier which is not accesible by the V3.
I am trying to use your SCIChartModifierBase class but cannot find anywhere a similar example of what we need.
I already tried to understand how you want us to use the ” override func onEvent(_ args: SCIModifierEventArgs!) ” function of the
SCIChartModifierBase but still no luck, it is impossible to figure out without any kind of a similar example.
The reason of needing an example is that this task needs much more information like these:
1. How to decide if the modifier should handle the touch event and how it should be ignored or handled by the next modifier in the same group ?
2. How to handle the touch started, changed, cancelled events ?
3. How to say in realtime to other modifiers in the same group that we need to to handle the same event simultaneously with this custom modifier ?
4. How to say to the group of modifiers that after the first modifer is taken the touch event then the rest should not use it ?

I will paste here our current implementation that we have done for V2 and needs to be transformed to V3 in case you need more details.

An important part is how we add the modifiers on the chart and this is how we are doing it right now:
let zoom = SCIPinchZoomModifier()
zoom.direction = .xDirection
let group = SCIChartModifierCollection(collection: [CustomModifier(chart: self),
PanModifier(),
zoom])
//group.handleGestureFirstOnly = true // Not existing in V3 anymore ! How should we do it in V3 ?
chart.chartModifiers = group

I believe that this code will be really useful for many people out there even for V2 or for migrating to V3.

Swift iOs code using SCICharts V2:

class Modifier: SCIGestureModifier {
private weak var control: ChartView?
private var editingProperty: ChartView.BindableProperty?
private var calculator: SCICoordinateCalculatorProtocol?

    init(chart: ChartView?) {
        self.control = chart
    }

    override func onPanGesture(_ gesture: UIPanGestureRecognizer?, at view: UIView?) -> Bool {

        guard let chart = view as? SCIChartSurface,
            let gesture_ = gesture
            else { return super.onPanGesture(gesture, at: view) }

        let location = gesture_.location(in: chart)
        switch gesture_.state {
        case .began:
            control?.sendActions(for: .touchDown)
            editingProperty = testForDraggableLine(location: location, in: chart)
            calculator = yAxis().getCurrentCoordinateCalculator()
            if editingProperty != nil {
                // Annotations on SciChart don't have Zindex and we want current line to be on the top
                let draggableLines = control?.chart.annotations.array.compactMap { $0 as? DraggableLine }
                if let myLine = draggableLines?.first(where: { $0.bindingKeyValue == editingProperty }) {
                    control?.chart.annotations.remove(myLine)
                    control?.chart.annotations.add(myLine)
                }
                control?.isTouchingLine(isTouching: editingProperty != nil)
            }
            return editingProperty != nil
        case .changed:
            if editingProperty != nil {
                handleDraggingLines(location: location, in: chart)
                return true
            }
        case UIGestureRecognizer.State.ended:
            if editingProperty != nil {
                control?.sendActions(for: .editingDidEnd)
                editingProperty = nil
                _ = control?.adjustYRange(force: true)
                control?.sendActions(for: .valueChanged)
                control?.refreshPositions()
                control?.isNotTouchingLine()
                return true
            }
        case UIGestureRecognizer.State.cancelled:
            if editingProperty != nil {
                control?.sendActions(for: .editingDidEnd)
                editingProperty = nil
                _ = control?.adjustYRange(force: true)
                control?.sendActions(for: .valueChanged)
                control?.refreshPositions()
                control?.isNotTouchingLine()
                return true
            }
        default:
            break
        }

        return false
    }

    private func handleDraggingLines(location: CGPoint, in chart: SCIChartSurface) {
        guard let renderSurface = chart.renderSurface,
            let yCalculator = self.calculator,
            let editingProperty = editingProperty else { return }

        let pointInChart = renderSurface.point(inChartFrame: location)
        let valueForYAxis = yCalculator.getDataValue(from: Double(pointInChart.y))
        control?.setValue(Decimal(valueForYAxis), forKey: editingProperty.rawValue)
    }

    // SOS: Filter possible properties that can be returned. We want to always avoid return - and then - dragging the current price bid or ask !
    private func testForDraggableLine(location: CGPoint, in chart: SCIChartSurface) -> ChartView.BindableProperty? {
        let hitTestDistance: Double = 30 // Pixels !
        let nearItems = chart.annotations.array
            .compactMap { $0 as? DraggableLine }
            .filter { item in
                return item.bindingKeyValue != ChartView.BindableProperty.ask &&
                    item.bindingKeyValue != ChartView.BindableProperty.bid &&
                    !item.isHidden &&
                    item.yDistance(from: location) <= hitTestDistance
            }
        return nearItems
            .sorted { $0.yDistance(from: location) < $1.yDistance(from: location) }
            .first?.bindingKeyValue
    }
}
  • Dxat asked 4 years ago
  • last active 3 years ago
0 votes
2k views

Hi, guys

My x axis is SCICategoryDateTimeAxis class type. And it’s limited by VisiableRangeLimit like:

[xAxis setVisibleRangeLimit:[[SCIDoubleRange alloc] initWithMin:SCIGeneric(firstItem – (lastItem – priorItem))
Max:SCIGeneric(lastItem + (lastItem – priorItem))]];

Also for scrolling my content inside chart:

SCIZoomPanModifier * zpm = [[SCIZoomPanModifier alloc] init];
[zpm setModifierName:@"PanZoom Modifier"];
[zpm setClipModeX:SCIZoomPanClipMode_ClipAtExtents];

Like a description SCIZoomPanClipMode_ClipAtExtents says:
“forces the panning operation to stop suddenly at the extents of the data” – but it’s not working constantly.
Sometimes it’s allow to scroll outside the range. Like on the attached image.

So my question is how to limit scrolling by min and max value?

Best regards,
Sushynski Andrei

1 vote
10k views

I’ve created a custom CHartmodifier like:

http://support.scichart.com/index.php?/Knowledgebase/Article/View/17255/32/custom-chartmodifiers—part-6—select-data-points-via-mouse-drag

My chart has different Markers: Point,Square and TrianglePointMarkers

How can I highlight this different markers (Fill gray if selected)?

0 votes
6k views

I just installed scicharts and tried to open the Launch SciChart v5 wpf example suite it just crashes on me. I am using windows 10 64bit. The event logs on windows shows:

1026
2
0
0x80000000000000

61382
Application
afogel-l-w10.tainstruments.com


Application: SciChart.Examples.Demo.exe Framework Version: v4.0.30319 Description: The process was terminated due to an unhandled exception. Exception Info: System.InvalidOperationException at System.Windows.Window.set_Owner(System.Windows.Window) at SciChart.Examples.Demo.App.App_DispatcherUnhandledException(System.Object, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs) at System.Windows.Threading.Dispatcher.CatchException(System.Exception) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr) at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef) at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame) at System.Windows.Application.RunDispatcher(System.Object) at System.Windows.Application.RunInternal(System.Windows.Window) at SciChart.Examples.Demo.App.Main()

Any clues?
Thanks!

0 votes
6k views

I encountered an exception inside scichart2d.js when I used hitTestProvider.hitTest.

getHitTestInfo(idx, e) {
let touch0 = e.targetTouches[0];
let rect = e.currentTarget.getBoundingClientRect();
let x = parseInt(touch0.pageX - rect.left);
let y = parseInt(touch0.pageY - rect.top);
const premultipliedX = x * DpiHelper.PIXEL_RATIO;
const premultipliedY = y * DpiHelper.PIXEL_RATIO;
let lineSeries = this.$store.state.components.scitchart.sciObj[idx].sciChartSurface.renderableSeries.items[0];
console.log(`lineSeries.hitTestProvider.hitTest(${premultipliedX}, ${premultipliedY}, ${DpiHelper.PIXEL_RATIO})`);
let result = lineSeries.hitTestProvider.hitTest(premultipliedX, premultipliedY, DpiHelper.PIXEL_RATIO);
return result;

}

The video URL is as follows
https://youtu.be/3GIlv_ldorY

0 votes
6k views

In financial markets, there is a type of chart that is as follows.

I did not find this type of chart in SciChart.

Please help me how to draw this chart

0 votes
7k views

Hi there,

We have implemented sci charts in our plotting application with great success so far. We currently have only one item outstanding. The users want to select points using a ‘lasso’ tool, basically they want to draw a custom shape and get all points within that shape to be selected.

So far we have implemented your example selected points using the square drag box. Is there anyway that the above requirement can be accomplished using your API?

Thanks for the help in advance !

Apologies if this is a duplicate question, I did search the forum but didn’t get any answers that match my question.

0 votes
7k views

Hi,

I’ve encountered an issue with the candlestick graph I’ve drawn that consists of a set of random X date time values – this causes the candlesticks have varying distances from one another.

Rendering the data from an initial set seems to be fine but as I run a NSTimer to add on more points, the body of the new candlesticks seem to be 0. (Note, the date time values are still random but have been made to be set after the last placed point)

In fact, the initial data points that I added see to be rendered ‘body-less’ if it’s within the same visible range as the newly added points. And if I pan along the newly added points, the bodies of some data points will appear at random visible ranges.

Is this a normal behaviour or should I take anything else into consideration?

Here are a couple of my configurations which I think may have affected anything:
1. My XAxis has set its visible range limit mode to ClipMode_Min
2. Candlestick series style data body width is set to be default.
3. I have a the following modifiers set up.

self.xDragModifier = [SCIXAxisDragModifier new];
self.xDragModifier.axisId = @"xAxis";
self.xDragModifier.dragMode = SCIAxisDragMode_Pan;
self.xDragModifier.clipModeX = SCIZoomPanClipMode_ClipAtMin;
[self.xDragModifier setModifierName:@"XAxis DragModifier"];

self.pinchZoomModifier = [[SCIPinchZoomModifier alloc] init];
[self.pinchZoomModifier setModifierName:@"PinchZoom Modifier"];
self.pinchZoomModifier.xyDirection = SCIXYDirection_XDirection;

self.zoomPanModifier = [SCIZoomPanModifier new];
self.zoomPanModifier.clipModeX = SCIZoomPanClipMode_ClipAtMin;
self.zoomPanModifier.xyDirection = SCIXYDirection_XDirection;
[self.zoomPanModifier setModifierName:@"ZoomPan Modifier"];

SCIModifierGroup * gm = [[SCIModifierGroup alloc] initWithChildModifiers:@[self.xDragModifier, self.pinchZoomModifier, self.zoomPanModifier]];
self.chartSurface.chartModifier = gm;

The points are drawing just fine, but the body of the candlestick is not appearing as expected.

Thanks in advance.

  • Elle Yeoh asked 7 years ago
  • last active 7 years ago
1 vote
0 answers
14k views

Hi,

I think I have found a bug. If LegendModifier has Margin (i.e. 10) it forces ModifierGroup to grow to VisibleWidth/Height 20×20. Than you can clearly see that the modifier group is placed outside the “chart area” and creates additional “topleft margin”.

Setting Grid.Row=”3″ and Grid.Column=”2″ on ModifierGroup looks like a fix.

Thanks

0 votes
6k views

I created a custom control and created a theme for the visual of the SciChartSurface. The goal is to add/remove Y Axes as needed. The problem is only one Scrollbar is created for all the axes and as I add an axis the scroll bar gets bound to the latest axis.

But if I implement it as View/ViewModel and not a custom control, it works fine.

I’m evaluating SciChart for use in our product is this is my only issue with it. Any Ideas?

  • Joe Morin asked 5 years ago
  • last active 5 years ago
0 votes
6k views

Hi,
Im tryin to create an effect where I have a static point on the Y Axis and I want to perform zoom in, so what I did is to increase or decrease the Max visible range, what I’m left with is the rubber band effect where my static point isn’t static anymore because the point in “Stretching” in the direction I’m zooming.

0 votes
6k views

i want o change SciChartInteractionToolbar default rubber band zoom mode to pan move .how to do it ?

1 vote
19k views

Hi there. I have many chartwindows each with price and volume panes. Each chart has own ViewModel instance as datacontext. I need cursor to be synchronized in each chart between price chart and volume chart.
If I write in xaml <s:ModifierGroup s:MouseManager.MouseEventGroup="xxx"> it synchronizes all cursors of all charts. So I’m trying to do the following:

<s:ModifierGroup s:MouseManager.MouseEventGroup="{Binding MyMouseGroup}">

In ViewModel (part of code from different blocks):

private string _myMouseGroup;
_myMouseGroup = Guid.NewGuid().ToString();
       public string MyMouseGroup
        { get { return _myMouseGroup; }  }

But it’s not worked, Cursors are not synchronized in one chart. I understand that MyMouseGroup should be not string type but dependency property though in Xaml I can use any string. But I don’t have enough programming knowledge to figure out how to do it. Please help with that MyMouseGroup property.

  • RTrade A asked 9 years ago
  • last active 9 years ago
0 votes
9k views

I am creating the dynamic Numeric Y axis. Tthese are the attributes i am setting

axis.VisibleRange = new VisibleRange (0, 100) 
axis.AxisTitle = axisViewModel.Title; 
axis.AutoRange = AutoRange.Never 
axis.AxisAlignment = axisViewModel.AxisAlignment; 
axis.BorderBrush = axisViewModel.BorderBrush; 
axis.BorderThickness = axisViewModel.BorderThickness; 
axis.TextFormatting = axisViewModel.TextFormatting; 
axis.DrawMajorGridLines = axisViewModel.DrawMajorGridLines; 
axis.DrawMinorGridLines = axisViewModel.DrawMinorGridLines; 
axis.DrawMajorTicks = axisViewModel.DrawMajorTicks; 
axis.DrawMinorTicks = axisViewModel.DrawMinorTicks; 
axis.GrowBy = axisViewModel.GrowBy; (0.1, 0.1) 
axis.TickTextBrush = axisViewModel.TickTextBrush; 

still it is auto ranging. Am I missing some attribute

  • HARISHTEI asked 8 years ago
  • last active 8 years ago
0 votes
10k views

Hi,

I’m creating lines chart with data from CSV file.
I have multiple series and each serie has its own YAxis.
As it comes from different CSV files, the number of series and their names are not known in advance.

I create the series in the code (MVVM) .

I’m using the trial version for 2 weeks now and before I purchase the licence, I have two questions:

1) I need to implement a function allowing the user to create multiple VerticalSliceModifier and display data for each serie on the graph and store data to a list or datatable.

Is it possible to have Vertical Slice Tooltip with multiple YAxis ?
If I create a vertical line annotation, can I get data for each serie crossing the line?

2) I need to be able to add annotation dynamically (measure, text, box, lines…).
Is there a way to save annotations to a list (and then to a file) so that if the user reopens the same CSV file he can load and display the corresponding annotations?

Thank you in advance for your answer,
Regards
Nicolas

0 votes
7k views

Hi

We have a requirement of creating a Time line chart similar to Gantt Chart,
Now we have created the same by increasing the thickness of Line chart,
But the main problem we are facing is line end cap, Currently it is rounded shape we could’t find a solution to make it flat.
We tried customrendarables series also but faced lot of issues while zooming and panning.

My question is whether you include following functionalities in the coming versions
1. Provide Gantt charts ?
2. Provide an API to change like end cap to flat ?

Regards
Abhilash R

  • Abhilash R asked 8 years ago
  • last active 8 years ago
0 votes
7k views

hi,
I see that my tooltips are cutoff when it is outside chart.
Please see attachment.
I use following teplate for tooltips.

Can you give me some pointers?

 <DataTemplate DataType="s:SeriesInfo">
        <StackPanel>
            <StackPanel.Resources>
                <Style TargetType="TextBlock">
                    <Setter Property="Foreground" Value="LightGray" />
                    <Setter Property="FontSize" Value="12" />
                </Style>
            </StackPanel.Resources>
            <TextBlock Text="{Binding SeriesName}" />
            <StackPanel Orientation="Horizontal">
                             <TextBlock Text="{Binding Angle}" />
            </StackPanel>
            <StackPanel Orientation="Horizontal">              
                <TextBlock Text="{Binding FormattedYValue}" />
            </StackPanel>
        </StackPanel>
    </DataTemplate>
2 votes
12k views

Hi

This is a little snippet of my code

<s:SciChartSurface SeriesSource="{Binding ChartSeries}"
                   YAxes="{Binding YAxisCollection}"
                   XAxis="{Binding XAxis}"
                   Annotations="{Binding AnnotationCollection}"
                   s:HorizontalGroupHelper.HorizontalChartGroup="horizontalChartGroup">

I would like to be able to set throught my ViewModel the “syncWidthGroup” of the HorizontalChartGroup like this.

s:HorizontalGroupHelper.HorizontalChartGroup="{Binding ChartGroup}"

But an exception is thrown saying I can only bind to DP og DO.

    System.Windows.Markup.XamlParseException occurred
  HResult=-2146233087
  Message=A 'Binding' cannot be set on the 'SetHorizontalChartGroup' property of type 'SciChartSurface'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.
  Source=PresentationFramework
  LineNumber=14
  LinePosition=324
  StackTrace:
       at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       at System.Windows.Markup.WpfXamlLoader.LoadBaml(XamlReader xamlReader, Boolean skipJournaledProperties, Object rootObject, XamlAccessLevel accessLevel, Uri baseUri)
       at System.Windows.Markup.XamlReader.LoadBaml(Stream stream, ParserContext parserContext, Object parent, Boolean closeStream)
       at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
       at Sekal.DrillScene.Desktop.Application.Views.TrackView.InitializeComponent() in c:\dev\projects\SekalApplications\Client\Sekal.DrillScene.Desktop\obj\Debug\decoratedxaml\Application\Views\TrackView.xaml:line 1
       at Sekal.DrillScene.Desktop.Application.Views.TrackView..ctor() in c:\dev\projects\SekalApplications\Client\Sekal.DrillScene.Desktop\Application\Views\TrackView.xaml.cs:line 10
  InnerException: 

So how would I go about doing this through code and not xaml, as I use ViewModel first approach and ViewModels are dynamically appended to an Items collection? (Using Caliburn.Micro)

0 votes
6k views

Hi

We use ViewportManager to automatically calculate the visible range of Y-axis for all series in the chart.

   <s:SciChartSurface Margin="0, 5, 0, 0"  Grid.Column="2"
                           ViewportManager="{Binding ViewportManager}"
                           MinHeight="250" MinWidth="250"
                           x:Name="MainChartSurface"
                           RenderableSeries="{s:SeriesBinding SeriesVms}"
                           ChartTitle="{Binding ChartModel.Title}"
                           Loaded="MainChartSurface_Loaded"
                           YAxes="{Binding YAxes}"
                           XAxes="{Binding XAxes}"
                           Style="{StaticResource YAxisStyle}"
                           Annotations="{s:AnnotationsBinding ChartModel.Annotations}">
      :
      : (omitted for brevity)
   </s:SciChartSurface>

This approach works fine for one chart.

We now have an additional requirement, which is to have the same VisibleRange for Y-axis over multiple charts. Basically, the VisibleRange should be set to be the [Min, Max] range over all the series in all charts.

Is there a way to achieve this with ViewportManager ?
Is there a way to make several charts related and assign it a common instance of ViewportManager?

BR, Gianni

0 votes
7k views

Hello,
I want to display a chart using a DateAxis as X-Axis. The data set contains values for each basic unit of chosen time base, e.g. for a time base of one month, I get 31 data points, with one value assigned for each day. I want the chart to display a label for each value assigned, but using automatic settings I get the following output:
enter image description here

I wanted to manipulate the ticks by setting the MajorDelta and MinorDelta properties, but it expects a value of type Date, and I’m not sure which value I should provide to get a timespan of 1 day, 1 hour etc.
I set EnableLabelCulling to false, but somehow it doesn’t seem to take any effect.

  • Anna Lazar asked 6 years ago
  • last active 6 years ago
0 votes
10k views

Hi there,

I created a simple map application. The map itself is displayed as a custom annotation (image) below the chart. The problem is, I can’t zoom into the custom annotation (map). The map will keep it’s original dimensions when zoomed. Is there a way to zoom in/out a custom annotation?

Tim

  • Tim asked 9 years ago
  • last active 9 years ago
0 votes
0 answers
9k views

Hello!

The legend is in horizontal orientation, and Im displaying multiple series.

When the legend is inside the chart (default config), Im able to scroll left or right to see all available series.

But when it is moved outside the chart, it is no longer scrollable. Checkboxes are still clickable to show or hide series.

Thinking it might be something interfering with the scroll gesture, I started a new project following the Android tutorial. It still stops working as soon as I move it outside the chart.

Is this a bug, or am I missing something?

This does not happens on iOS.

Regards

XML Layout
`

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical">

    <LinearLayout
        android:layout_margin="30dp"
        android:id="@+id/chart_layout"
        android:layout_width="match_parent"
        android:layout_height="500dp"
        android:orientation="horizontal"/>

    <com.scichart.charting.visuals.legend.SciChartLegend
        android:id="@+id/legend"
        android:layout_width="match_parent"
        android:layout_height="40dp"
        android:layout_margin="10dp"/>
</LinearLayout>

`

Legend and LegendModifier config

    final SciChartLegend legend = findViewById(R.id.legend);
    legend.setLegendOrientation(Orientation.HORIZONTAL);

    final LegendModifier legendModifier = new LegendModifier(legend, false);

    surface.getChartModifiers().add(legendModifier);
0 votes
0 answers
4k views

I have a requirement to save a chart as an image to a Crystal Report. I can pass a byte[] of the image using ExportToBitmapSource() and then converting this to a byte array using a MemoryStream. However, quality is significantly lost in the process. Here is an example of my source.

MyChart.RenderPriority = RenderPriority.Immediate;
MyChart.ZoomExtents();
var bitmap = MyChart.ExportToBitmapSource();

using (MemoryStream stream = new MemoryStream())
{
    BitmapEncoder encoder = new PngBitmapEncoder();
    encoder.Frames.Add(BitmapFrame.Create(bitmap));
    encoder.Save(stream);
    byte[] bytes = stream.ToArray();
}

Later on I set the value of a blob field of the dataset passed to the Crystal Report to this byte array.

Quality of the image is pretty good when I save directly to file, but most important when I use the MyChart.ExportToFile() I actually lose some of the markup annotations when I set the “useXamlRenderSurface” to true. I.e. I have custom text markups that show a border and the border doesn’t get saved with the image.

The thing about the Crystal Report is that our report designer can set the actual size of the image to be shown in terms of inches. If I am able to save/export the chart image in those same proportions I believe the image would look fine since it wouldn’t be getting stretched in the report.

Suggestions?

0 votes
4k views

I created a CustomRenderableSeries to put TextAnnotations on surface for every drawn point.

I discovered that Draw method is not called when no points are to be drawn in the visible range, so i can’t do any cleanup of the annotations i created in a previous pass.

Is there a way to force Draw method to be called anyway upon surface redraw (for example when zooming)?

Thank you

1 vote
9k views

Hello.

In my 2D scatter chart, I’d like to set markers in a defined region of x and y to a different colour from the rest of the markers. I know I can do this with two data series (where one series is for the points within the region, and the other series is for all the other points) but is there a way to do it with one data series?

I was expecting to be able to do it in a similar way as I did it for a 3D scatter, setting the colour of the marker when I append it to the series:

xyzDataSeries3D.Append(x, y, z, new PointMetadata3D(color, 1));

Thanks for any help,
Daryl.

1 vote
6k views

Hi,
I’ve only really just got started with Scichart.
I’ve created a realtime ticking chart using candlesticks.
Its based on the examples.

The problem I have is that if I add 200 points to the graph, the graph is zoomed out so that all 200 points are on screen and visible.
I want to zoom in a bit and position the visible area to the latest points. To the front (right). The user can then scroll left to see previous points.

I’ve tried a couple things like…

        IRange visibleRange = surface.getXAxes().get(0).getVisibleRange();
    visibleRange.setMax(20.09);



    IRange foo = surface.getXAxes().get(0).getMaximumRange();
    visibleRange.setMinMaxDouble(foo.getMaxAsDouble(), foo.getMaxAsDouble());

The set max works, but I cant figure out how to position the view to the latest points (the very right)

Can someone help?

Thanks
Aidan

  • Aidan Mack asked 8 years ago
  • last active 8 years ago
0 votes
10k views

I have an issue where I attempt to zoom/pan with a ZoomPanModifier only in the X direction. At the same time I would like my Yaxis to stay set at my current boundaries. The problem is that when I first load up the chart everything works fine, but when I pan left and right the YAxis auto ranges itself and never uses the current boundaries I have set. And once I’m done zooming the auto Range stays on. Here is the sample code.

<Custom:ZoomPanModifier x:Name="zoomPanModifier" IsEnabled="True" ExecuteOn="MouseRightButton" XyDirection="XDirection" />
<Custom:SciChartSurface.YAxis>
<Custom:NumericAxis DrawMinorGridLines="False" AxisTitle="Value" TextFormatting="#,##0" x:Name="YAxis" AutoRange = "False">
<Custom:NumericAxis.VisibleRange>
<Custom:DoubleRange Min ="0" Max ="2200"></Custom:DoubleRange>
</Custom:NumericAxis.VisibleRange>
<Custom:NumericAxis.GrowBy>
<Custom:DoubleRange Min="0.1" Max="0.1"/>
</Custom:NumericAxis.GrowBy>
</Custom:NumericAxis>
</Custom:SciChartSurface.YAxis>

Would like to know If maybe I’m setting the auto range somewhere else I don’t know about or this problem is recreatable on your side. Thanks.

0 votes
6k views

Hi all,

Upfront apologies – I suspect this is a bit of a complicated set of information I’m looking for, as the UI specs are rather strict on what we’re looking for.

I’m getting to the last few functionalities I need to test, and I believe I’ve proof of concepted nearly everything I need. and I suspect I know what needs to be customized for my requirements. I wasn’t exactly sure how to implement some parts though, and the documentation for the android tick provider suggested that I look for assistance.

https://www.scichart.com/documentation/android/v2.x/webframe.html#Axis%20Ticks%20-%20TickProvider%20and%20DeltaCalculator%20API.html

My remaining goals are to have an X-axis that is…

  1. X-axis is above and below the top and bottom charts. I figure I can handle this dynamically by setting the axis visibility to true depending on which charts are visible – should be easy.

  2. X-axis needs to be on 1 hour ticks (on the hour). The zoom range will go from 3 hours to 72 hours, and I will limit the pan to the nearest hour prior and after the current data. I assume I need to override tick provider. The x axis should look like 12:00 AM, 1:00 AM, 2:00 AM, 3:00 AM, and so forth. If the zoom is at 72 hours, it’ll show something like 12:00AM, 3:00AM, etc. I don’t think this part needs to be customized, and will automatically be handled by the default delta provider (Unless I’m mistaken, I can just specify max number of ticks on screen somewhere, and it’ll handle accordingly). – This one seems rather complicated.

  3. I’d like to display the date on the 12:00AM entries of the x axis. As such, each “12:00 AM” tick will have “Jan 1” below it or the like. -Not sure how feasible this one is, and may push back on this requirement and skip it if it’s not doable.

Do you have an example of how to implement a custom tick provider/have any suggestions (also – please let me know if I’m barking up the wrong tree and I should be taking an entirely different approach).

Thanks!
-Andy

1 vote
7k views

This might be a feature request, I don’t know. Basically, I’m trying to plot a 3D scatter-plot and programmatically insert an arbitrary number of partially transparent free surface meshes in the same area as the scatter-plot. I started small and made some spheres. Some of my points are inside the spheres. These points are important, and I have my own functions that detect collisions between points and the spheres. The scatter-plot is also dynamic, where I update the color and transparency of the points and this means something. When all of the points are completely opaque, I get the desired behavior where I can see the points inside and behind the partially transparent meshes. However, when I make even one point transparent, all of the points inside and behind the mesh stop rendering. This is really annoying. Deletion is too slow. Is there anyway to force these fully opaque points to continue to render inside the partially transparent mesh while their brothers in the scatter-plot data series are transparent?

Second question, while I’m here. I’ve bolted a UI to the side of the Sci-Chart environment. What is the best way to make sure that the UI stays responsive even if the Sci-Chart environment starts to slow down? I want to crank up the point count past any reason.

https://www.youtube.com/watch?v=0IBBG6WEQw8 I’ve also uploaded a video of my problem. Before I check the box “Draw Geo-fence Violations Only”, all points in the data series 100% not transparent. When I check the box, all the white points start to become 100% transparent. When I click “Draw Geo-fences”, the meshes become 100% transparent (it’s backwards I know). The points are obviously still within the bounds of the mesh, as when the I turn off the mesh they start rendering. You can also see some red dots outside the mesh, as my program flagged a few points right next to the mesh as being inside it. These red dots outside the mesh render even when the red dots inside the mesh don’t.

0 votes
0 answers
3k views

Hi, i am using scichart v6.2.0.13254 and v6.2.1.13304, when i insert data it will cause the System.AccessViolationException,below is a very simple example, when it run,click LoadMoreData a few times it will throw the exctipion.

1 vote
6k views

Trying to make a spectrum analyzer with a column chart instead of a line chart. Is there a way to animate the column so that the column automatically starts a slow fall back to zero after appended to?

This link has a you tube video that shows the effect that we are looking for in the upper left hand corner

This link shows a hardware version but it is the same effect that we are looking for.

Thanks

  • Shawn asked 9 years ago
  • last active 9 years ago
0 votes
0 answers
5k views

I’m trying to run my WPF with SciChart aplication in the separate AppDomain, but method SciChartSurface.SetRuntimeLicenseKey() is not working for me – no any exception, but in SciChart control I can see “Sorry! Your trial of SciChart has expired. Please contact sales if you require an extension.” instead of Chart.

In the default AppDomain it works fine.

I tried to run SetRuntimeLicenseKey method from both AppDomains – Default and separate, but without luck.

0 votes
13k views

Hi Guys,

I have successfully added text labels to my charts using ILabelProvider.

However, some of the charts are showing duplicate labels for each bar, and others are not showing the labels for all bars (even though there is space to do so).

Any idea how to fix these? See the attached images for more details.

Thanks in advance.
Andre.

  • andrecsa asked 8 years ago
  • last active 8 years ago
0 votes
10k views

Please consider adding Footprint (MarketDelta) charts.

1 vote
12k views

Hi I am implementing a chart on Android with 24 Hours of data viewable in 1, 2, 4, 8, 12 and 24 hours windows. The chart is drag-able upon the xAxis only. The full extent of the yAxis is always visible.

I am struggling to control the rate of scroll compared to the drag speed. What is desired is always a perceived one to one ratio of movement. This means that a data point’s movement distance when scrolled is the same is the point of touch’s movement distance regardless of zoom level.

I am currently using:

    ChartModifierCollection surfaceChartModifiers =  surface.getChartModifiers();
    XAxisDragModifier dragModifier = new XAxisDragModifier();
    dragModifier.setDragMode(AxisDragModifierBase.AxisDragMode.Pan);
    dragModifier.setClipModeX(ClipMode.ClipAtExtents);
    surfaceChartModifiers.add(dragModifier);

    ZoomPanModifier zoomPanModifier = new ZoomPanModifier();
    zoomPanModifier.setClipModeX(ClipMode.ClipAtExtents);
    zoomPanModifier.setDirection(Direction2D.XDirection);
    zoomPanModifier.setZoomExtentsY(false);
    surfaceChartModifiers.add(zoomPanModifier);

Currently however the ratio does not appear to be one to one the scrolling move further than the touch drag distance.

How can I achieve this?

0 votes
6k views

Hello,

I’m using line series with LineDrawMode.Gaps, if dataseries contain single points with gaps, chars looks empty. I found only one way to see the data points – set PointMarker, but in other cases without gaps, point marhers are not needed for the line series. Is there any way to show single points when gaps are presented w/o point markers or paint point markers only for single series?

                    var renderableSeries = new FastLineRenderableSeries()
                    {
                        Stroke = DataManager.Instance.GetRandomColor(),
                        DataSeries = dataSeries,
                        StrokeThickness = 2,
                        DrawNaNAs = LineDrawMode.Gaps,
                    };
                    //renderableSeries.PointMarker = new EllipsePointMarker() { Width = 5, Height = 5, Fill = renderableSeries.Stroke, Stroke = renderableSeries.Stroke, StrokeThickness = 2 };
                    sciChart.RenderableSeries.Add(renderableSeries);
0 votes
11k views

It seems most of the modifiers bring up tooltip data with a pan, and then it goes away when the user lifts their finger. Is there any way to bring up tooltip data with a tap (and does not go away when the finger has lifted)? The main problem that we’re trying to solve is that we would like to be able to pan to look at the chart (and don’t want an axis pan), but would also like to bring up tooltip data.

  • Carolyn asked 5 years ago
  • last active 5 years ago
0 votes
8k views

I want to align my left YAaxis labels to right and fixed label width. I use Spectrogram view and want to align the left edges of those charts. (I’m using version 4.0.2)

This is my style definition:

 <Style x:Key="LeftAxisLabelStyle" TargetType="s:DefaultTickLabel">
    <Setter Property="HorizontalAnchorPoint" Value="Right"/>
    <Setter Property="Width" Value="20"/>
 </Style>

but unfortunately it doesn’t work.

1 vote
11k views

Hi,

After I’ve added some TextAnnotations on the graph, I’ve noticed that the TextAnnotations and CustomaAnnotations doesn’t resize with the view. They all stay constant in size. I’ve found a previous question about this in here: https://www.scichart.com/questions/question/text-annotation-size

But I’m not getting the results I hoped for with this. The test is still not resizing with the surface. Since it’s been a while that a question was asked about this, maybe there are new methods to do this in Scichart?

Thanks

  • kewur asked 9 years ago
  • last active 9 years ago
1 vote
5k views

Lets imagine that we have zoom feature and we want to format axis depend on user selected zoom. for example if year select yearly the pattern is yyyy MM dd and if selected zoom is day the pattern is something like this HH:mm:ss. how we can achieve to this goal?

3 votes
16k views

I was trying to figure out why I couldn’t get minor tick marks to appear on my axes and then I realized it’s because of the theme I was using (BrightSpark). Just a heads up to anyone else who may run into this.

IMO themes should not hide chart features such as tick marks.

0 votes
5k views

I am learning the official sample program: 2D Charts > Create Realtime Charts > 50-Channe EEG

I would like to modify this sample program to add a horizontal scrollbar and synchronize control of all channels, How do I do that?

The scrollbars need to be bound to an X-axis, but the charts in this example are in the ListBox and loaded from a template. How can I do this? Can you give me an example

  • hundun wds asked 2 years ago
  • last active 2 years ago
0 votes
5k views

I am Using ECG Chart In Android. How To Make The ECG Moves Automatically in Horizontal.

1 vote
1k views

Hello,
I just want to override the ChartModifier property in the style

I have tree charts one after the other and only the last chart has a legend. It seems I cannot use a style with the same key multiple times.

<Style x:Key="ChartWithMyModifiers" TargetType="{x:Type s:SciChartSurface}">
    <Setter Property="ChartModifier">
        <Setter.Value>
            <s:ModifierGroup>
                <s:ZoomPanModifier ExecuteOn="MouseRightButton" ClipModeX="None" />
                <s:YAxisDragModifier DragMode="Scale"/>
                <s:XAxisDragModifier DragMode="Scale"/>
                <s:MouseWheelZoomModifier/>
                <s:ZoomExtentsModifier ExecuteOn="MouseDoubleClick" />
                <s:LegendModifier ShowLegend="True"/>
            </s:ModifierGroup>
        </Setter.Value>
    </Setter>
</Style>

The result screen is attached.
Thanks, Gabor

1 vote
776 views

https://stackoverflow.com/questions/77752586/reactjs-sweep-line-demo-issue-with-multiple-surfaces-not-updating-simultaneousl

I need to make a demo of a sweep line with multiple surfaces with reactjs, but The problem is that when I choose to show more than 1 surface it only plays on the data on the latest created surface and stops drawing data on the old surfaces.

you can see the example here with the code: https://28zf6p.csb.app/

this is a GIF for the problem:
[in the stack overflow link]

note: the reason I need multiple surfaces is that I want to have the charts draggable with sortableJS to follow the design I got.

0 votes
9k views

I am considering applying server-side licensing for my javerScript application.

In the document below, there is a phrase “Our server-side licensing component is written in C++.”
(https://support-dev.scichart.com/index.php?/Knowledgebase/Article/View/17256/42/)

However, there is only asp.net sample code on the provided github.
(https://github.com/ABTSoftware/SciChart.JS.Examples/tree/master/Sandbox/demo-dotnet-server-licensing)

I wonder if there is a sample code implemented in C++ for server-side licensing.

Can you provide c++ sample code?
Also, are there any examples to run on Ubuntu?

  • Marcel asked 11 years ago
  • last active 10 years ago
1 vote
1k views

I’m trying to add an AxisMarkerAnnotations for some line series on my chart.

I was following these questions answered here:
https://www.scichart.com/questions/js/adding-axis-markers-to-fastlinerenderableseries
https://www.scichart.com/questions/js/price-indicators-on-yaxis

I managed to render the axis marker for my series. Now I’m trying to the set the Y value of the marker annotation as the value where the line intersects the Y Axis.
I want the marker value to be the last value of the series, only if the xAxis.visibleRange.max > series.XdataRange.max.

The two attached images show the desired feature.
One shows the marker annotation with the Y1 being the one where the line intersects the YAxis.
The other shows the marker annotation with the Y1 being the last value of the line, because it is visible.

I read some answers here on the forum about using the HitTest API to do this, but I couldn’t make it work on my JS app

0 votes
9k views

I am using latest version of SciChart through Pods. I am using trial key for now.

I have made all the views under the chart clear. And have tried the code below but the background appears to be shades of black.

     let yAxis = SCINumericAxis()
     let xAxis = SCINumericAxis()
     self.surface.xAxes.add(xAxis)
     self.surface.yAxes.add(yAxis)

     self.surface.backgroundColor = UIColor.clear
     self.surface.isOpaque = false
     self.surface.renderableSeriesAreaFill = SCISolidBrushStyle(color: UIColor.clear)
     self.surface.renderableSeriesAreaBorder = SCISolidPenStyle(color: UIColor.clear, withThickness: 0)
  • Ayush Jain asked 5 years ago
  • last active 5 years ago
0 votes
8k views

Hi,

  1. I am evaluating scichart, i am able to debug things in visual studio express however when i try to run the exe standalone it does not work. Is this limited because of demo mode?

  2. I want to do a subplot thing i.e. two separate charts however the marker needs to be linked between the two, what is the right approach to do this? Which examples and methods do i need to look at?

regards
Manish Bhardwaj

1 vote
5k views

Has anyone ever encountered this problem?
Could you give me a help? How to solve this problem?
The app didn’t run in the method of ‘getStrokeColors()’, when I debugged.

public class BubbleChartFragment extends ExampleBaseFragment {
    ...

    {
    ...
    FastBubbleRenderableSeries mRSeries = sciChartBuilder.newBubbleSeries()
                    .withDataSeries(dataSeries)
                    .withZScaleFactor(zScaleFactor / 10f)
                    .withBubbleBrushStyle(new SolidBrushStyle(0xffff0000))
                    .withAutoZRange(false)
                    .withStrokeStyle(0xff00ff00, 20f)
                    .withPaletteProvider(new StrokePaletteProvider())
                    .build();
    }

    private class StrokePaletteProvider extends PaletteProviderBase<FastBubbleRenderableSeries> implements IStrokePaletteProvider {
            private final IntegerValues colors = new IntegerValues();
            private final int[] desiredColors = new int[]{0xFF00FF00, 0xFF0000FF};

            protected StrokePaletteProvider() {
                super(FastBubbleRenderableSeries.class);
            }

            @Override
            public void update() {
                final BubbleRenderPassData currentRenderPassData = (BubbleRenderPassData) renderableSeries.getCurrentRenderPassData();

                final int size = currentRenderPassData.pointsCount();
                colors.setSize(size);

                final int[] colorsArray = colors.getItemsArray();
                final int[] indices = currentRenderPassData.indices.getItemsArray();
                for (int i = 0; i < size; i++) {
                    final int index = indices[i];
                    colorsArray[i] = desiredColors[index % 2];
                }

            }

            @Override
            public IntegerValues getStrokeColors() {
                return colors;
            }
        }
    }
  • SiYuan Ou asked 5 years ago
  • last active 5 years ago
Showing 1 - 50 of 4k results