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

0 votes

I am not sure what the problem is / or fully understand the question, however you seem to be wanting to make a Strip Chart with SciChart WPF (a chart which scrolls automatically when new data arrives).

We have a KB article on how to do this here: How to Create a Scrolling Strip Chart in SciChart?

enter image description here

And also a code sample here: https://github.com/ABTSoftware/SciChart.WPF.Examples/tree/master/v5.x/Sandbox/UsefulExamples/Examples/StripChart

Please let me know if this helps,

Best regards
Andrew

0 votes

Hi there,

Interesting requirement you have there! Yes I think you can do this. Try using a Custom Annotation. The Create Annotations Dynamically example shows how to insert an image inside a CustomAnnotation type.

  • You will need to set CoordinateMode = CoordinateMode.Relative, AnnotationCanvas = AnnotationCanvas.BelowChart and X1, Y1 = 0.
  • You will also need to listen to SizeChanged events of the parent SciChartSurface and resize the CustomAnnotation (width, height) to fit.
  • Ensure your CustomAnnotation.Width matches the SciChartSurface.ModifierSurface.Width and CustomAnnotation.Height matches the SciChartSurface.ModifierSurface.Height.

Thanks!

Andrew

0 votes

Hi Yurij,

How do I recreate it when it is declared this way in xaml and
I do not have reference to the AnnotationCreatorChartModifier itself?

0 votes

Hi Evgeniy,

You can use TextAnnotation as tooltip which is always showed. To place it in left corner you can use relative coordinate mode and then assign X1 = 0. To get information about of clicking you can use HitTest API provided by RenderableSeries. There is an example which shows how to use it.

Is this suitable for your needs?

Best regards,
Yura

1 vote

Hi Benjamin,

Thank you for the sample. We’ve investigated it and noticed, that you don’t update the VisibleRange on the XAxis, so the incoming data don’t appear.

By default, when you append data, SciChartSurface redraws, but does not update the XAxis or YAxis visible ranges. However you can turn on chart automatically scaling to fix data by setting AutoRange=”Always” on an axis, as it is demonstrated in our Performance demo example.

But in this case you loose interactivity via modifiers, because autorange is performed on every chart redraw.

Besides that, you could update the VisibleRange manually, as it is demonstrated in the Realtime Ticking StockChart example.

We have an article on this topic here:
http://support.scichart.com/index.php?/Knowledgebase/Article/View/17223/37/how-to-have-a-fixed-scrolling-time-range-on-the-xaxis-that-works-with-modifiers

http://support.scichart.com/index.php?/Knowledgebase/Article/View/17203/0/autorangenever-vs-autorangeauto-vs-autorangealways

https://www.scichart.com/questions/question/numericaxis-autoalignvisiblerange-without-autorange

Hope the above helps! Please feel free to comment if you have any more questions,

Best regards,
Yuriy

  • Guest answered 8 years ago
  • last active 8 years ago
0 votes

Hi,
Thanks for your reply.
Is it possible to display permanently RolloverModifier in android device ?
Best regards.
Dominique.

0 votes

Hi,

Thanks for the screenshot. OK, seems that you need to change modifier’s behavior slightly. When overriding OnModifierMouseMove(..), you can find ModifierMouseArgs.IsMaster property in passed parameter. If it is “True”, then HandleMasterMouseMove(..) method is called, and HandleSlaveMouseMove(..) otherwise. So inside
HandleSlaveMouseMove(..) only vertical line is drawn. You need to change this behavior in OnModifierMouseMove(..) override and set IsMaster=”True” every time. Also, take look at sync modifier across charts with diff width thread, it should give you next hint.
..and maybe you could find something useful in this thread.

Please, let us know if you need more assistance on doing this,

Best regards,
Yuriy

0 votes

Good day!
Thank you for the reply! I’ve recorded a work of the test project in a gif file and there is an example in zip archive. I’ve attached it below.

Steps to reproduce the error:
1)launch the program
2)zoon in it several times with mouse wheel

  • Egor answered 8 years ago
  • last active 8 years ago
1 vote

Hi Egor,

Thank you for inquiring us. As to your question, it is possible to achieve using the PaletteProvider feature. Please take a look at this article on the topic from our Knowledgebase. Also you could find an example in our online demo.

Hope this helps,

Best regards,
Yuriy

  • Guest answered 7 years ago
  • last active 5 years ago
0 votes

OK so silly question but have you included sharpdx_direct3d11_1_effects_x86.dll in your application with ‘Copy to output directory = Always’ as per our instructions here?

When including SharpDX from NuGet there is no need to include these libraries as they are automatically copied to output when the application is run.

However, if the designer fails to pick them up then it could be a problem with SharpDX or the Visual Studio Designer process itself. In which case we’d recommend simply including the libraries sharpdx_direct3d11_1_effects_x86.dll and sharpdx_direct3d11_1_effects_x64.dll manually in your project with ‘Copy to output = Always’

Update – Disable DirectX in design mode

This problem could also be resolved by only applying DirectX when not in design mode. Please see this StackOverflow question for how.

<Style TargetType="{x:Type s:SciChartSurface}">
    <Style.Triggers>
        <Trigger Property="ComponentModel:DesignerProperties.IsInDesignMode"
                 Value="False">
            <!-- Only apply TryApplyDirectXRenderer=true when Not in designer -->
            <Setter Property="s3D:DirectXHelper.TryApplyDirectXRenderer" Value="True" />
        </Trigger>
    </Style.Triggers>
</Style>

Best regards,
Andrew

0 votes

We perform a lock() around a syncroot object which halts rendering. If rendering is occuring now, we wait until its finished (hence your variable time) then lock()

That can indeed explain the variable time, thanks !

You also reduce thread-contention if you are appending on a background thread and drawing on the UI thread

The multi-threading seems a reasonable solution but my question is slightly different. To rephrase it, given that I append data in a separate thread, how can I stabilize calling times of Append() in that thread? As you can see on the plot 2, there are still occasional 5 ms peaks in the calling times, while the majorly of them are within 1 ms. Is there a better solution than using BeginInvoke? Are there some settings that can make the calling times more stable, rather than just faster?

  • corvex answered 2 years ago
  • last active 2 years ago
0 votes

Hi there,

Well to do this you’ll need to create custom LegendItem or extend default one and override font and colors. Then you need to create factory for new items:

    class CustomLegendItemFactory extends DefaultLegendItemsFactory {
    @Override
    protected LegendItemBase createLegendItem(View legendItemView) {
        return new CustomLegendItem(legendItemView);
    }

    public static class CustomLegendItem extends DefaultLegendItem {
        public CustomLegendItem(View itemView) {
            super(itemView);
        }

        @Override
        public void bindSource(Object source, SciChartLegend legend) {
            super.bindSource(source, legend);

            // change TextView properties of item
            name.setTextColor(Color.RED);
            name.setTypeface(Typeface.MONOSPACE);
        }
    }
}

After that just need to use new factory during creation of LegendModifier and pass it into chart:

  LegendModifier legendModifier = new LegendModifier(new SciChartLegend(getActivity()), new SeriesInfoLegendAdapter(new CustomLegendItemFactory()), true);
  legendModifier.setLegendPosition(Gravity.TOP | Gravity.START, 16);
  Collections.addAll(surface.getChartModifiers(), sciChartBuilder.newModifierGroup()
                    .withModifier(legendModifier)
                    .build());

Is this suitable for your needs?

Best regards,
Yura

0 votes

Update: SciChart v3.0

In SciChart v3.0 the modifiers have all been enabled to use MultiTouch. Please see our Release note on SciChart v3.0.2 What’s New

4. MultiTouch support

Zooming, panning, axis manipulations, cursors, annotation manipulations via touch screens in WPF and SL

Usage:

Multitouch is enabled by default in SciChart and all existing modifiers now have touch-support. To get a touch-specific pinch zoom action please use the PinchZoomModifier.

0 votes

Update: June 2014

We have gone through all the tutorials on Screenshots, Printing to XPS, Export to Bitmap and updated them. Please see the updated links below below.

The Screenshots, XPS Printing, X-Axis Text Labels article now has an updated sample which compiles against SciChart v3.0 so you can download it and get started.

Hope this helps!
Andrew

0 votes

Hi Mike,

It’s a tricky problem to solve. You’re asking vendor A and vendor B to play nicely 🙂

yes, we require IPointmetadata interface on your ‘data-point’ but if you have MVVM setup whats to stop you implementing IPointMetadata on your view model that a row (and a data-point) is bound to?

e.g you don’t modify the DataRow, but the object it binds to.

Can that help?

Best regards,
Andrew

0 votes

I solved it by first checking if the point was in bounds using the BasePointMarker.IsInBounds method.

1 vote

Hi Gourav,

It looks like you didn’t call init() in your code ( or at least you didn’t post a code fragment which contains it) so SciChartBuilder returns null when you call getInstance(). Can you try to add it before calling SciChartBuilder.getInstance()

  SciChartBuilder.init(context);

Hope this will help you!

Best regards,
Yura

0 votes

Hi Naveen

We have a sample on how to do this here:

ChartModifierBase Get Notification of MouseDown on Axis or Chart pane

Let me know if this helps,

Best regards,
Andrew

0 votes

Hi Aysan,

It’s actually possible now in v4 of SciChart.

In v4 you need to implement IStrokePaletteProvider to colour the line segments and optionally IPointMarkerPaletteProvidwr to colour the points.

If you search for PaletteProvider in our SciChart WPF v4 Examples Suite you will find applicable examples.

Let me know if this helps!

Best regards,
Andrew

0 votes

Markiyan,

I have tried the new DLLs. I’m still seeing some issues. The SelectionChanged event for the DataPointSelectionModifier is being triggered now every time, but for some selections the palette provider is not coloring the selection correctly.
This is especially true when you have successive clicks in a time span less than one second, or two seconds the most.

Showing 1 - 20 of 5k results