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

0 votes
166 views

Hi.
I have a line chart where i add data continuously from different sensors.
The code looks like this

protected open fun setupChart() {
    surface = requireView().findViewById(R.id.sciChartId)
    xAxis = NumericAxis(context).apply {
        autoRange = AutoRange.Always
        drawMajorGridLines = false
        drawMajorBands = false
        drawMinorGridLines = false
    }
    yAxis = NumericAxis(context).apply {

        drawMajorGridLines = false
        drawMajorBands = false
        drawMinorGridLines = false
        axisAlignment = AxisAlignment.Left
        // axisId ="First id"
    }
    dataSeries1 = XyDataSeries(Double::class.javaObjectType, Double::class.javaObjectType).apply {
        seriesName = "Line A"
        acceptsUnsortedData = true
    }

    val line1Color = Color.BLACK // ColorUtil.argb(0xFF, 0xFF, 0xFF, 0x00)

    val line1 = FastLineRenderableSeries().apply {
        strokeStyle = SolidPenStyle(line1Color, true, 1F, null)
        dataSeries = dataSeries1
        // yAxisId = "SecondId"
    }

    val legendModifier = LegendModifier(context).apply {
        setLegendPosition(Gravity.TOP or Gravity.START, 16)
        setOrientation(Orientation.VERTICAL)
        setSourceMode(SourceMode.AllSeries)
    }
    series.add(line1)

    UpdateSuspender.using(surface) {
        surface.xAxes.add(xAxis)
        surface.yAxes.add(yAxis)
        // surface.yAxes.add(yAxisTwo)
        surface.renderableSeries.addAll(series)
        surface.chartModifiers.add(legendModifier)
        surface.setBackgroundColor(Color.WHITE)

        series.forEach {
            AnimationsHelper.createAnimator(
                it,
                SweepXyTransformation(XyRenderPassData::class.java),
                3000,
                350,
                DecelerateInterpolator(),
                FloatEvaluator(),
                0f,
                1f
            ).start()
        }
    }

    addXAxisDragModifier()
    addZoomPanModifier()
    addZoomExtentModifier()
    addPinchZoom()
    surface.zoomExtents()
}

And the code adding data looks like this

dataSeries1.append(value, someOtherValue)

I understand that zooming is not possible when you set AutoRange to Always.
However i have not seen any working example where zooming is enabled at the same time as you add data continually.
Is it possible to zoom at all with real time without setting autoRange and if yes can you refer to any working example you have

  • Arbon Vata asked 1 month ago
  • last active 1 month ago
0 votes
358 views

Hello,

At right chart we have show only one X-axis which needs to update in real time .whenever new values will come we have to update in X-axis in itself instead of adding new line at X-Axis.

Each time New Y – axis will come that will append at left chart (Can be consider left chart showing history of right chart)

Let me know if anything further requred

Thanks.

0 votes
970 views

Hello SciChart Team,

We are using SciChart v6.1.1.13156 since about a year in our main software that is used by customers worldwide.
The SciChartSurface-Style that all charts use is configured to use the VisualXcceleratorEngine (in DirectX9 mode, as some customers had problems with invisible charts on specific older intel graphics chipsets).

In the last weeks we had several inqiuiries from customers (from Japan, Korea), that the charts in their software do not update when adding new values, the chart is only updated when minimizing and then showing the window again. Another issue was that the X-Axis was updated fluently but the chart (line-chart) only very irregularly (about 2-3 times in a 30sec measurement which provides a value every 20msec). All of these customers use new laptops with 11th generation Intel CPUs. One of these had an Nvidia-graphics card installed an when forcing to use it with our software the charts worked perfectly.

We added an option in our software to Enable Software Rendering (Highspeed Renderer) to increase compatibility when having the above mentioned issues as we thought that it has to do with the VisualXcceleratorEngine, but this did not change anything unfortunately.

We want (and have) to solve this problem as this breaks the functionality of our software with some of our biggest customers.

Best regards,
Oliver from Cologne Germany

0 votes
2k views

Hi, i am trying to read an excel file which contains a few column of data to be plotted. The number of series depends on number of column in the excel file. Hence, the number of series need to be plotted dynamically. Besides, for each series, the data in not plotted in one shot. There is a timer used to plot each data point dynamically.

I am trying to use “ObservableCollection” in this case, i able to create the fastlinerenderableseries and XyDataSeries for each line series and add them into the ObservableCollection. However, i do not know how to have the real time update on each line series.

Please provide me some guide or tutorials.
Looking forward for your reply.
Thanks

  • mian ooi asked 2 years ago
  • last active 1 year ago
Showing 4 results
This template supports the sidebar's widgets. Add one or use Full Width layout.