Advertisement
Guest User

Untitled

a guest
Aug 12th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
QML 1.17 KB | None | 0 0
  1.     QtObject {
  2.         id: __private
  3.  
  4.         /**
  5.           * @brief initialised cell, if cell has chartView and configurationProxy
  6.           */
  7.         function initIfCan() {
  8.             if (!itemRoot.chartView || !itemRoot.configurationProxy || !_yAxis) return
  9.             var oldSeries = chartView.series(itemRoot.seriesName)
  10.             if (oldSeries) chartView.removeSeries(oldSeries)
  11.             var series = chartView.createSeries(ChartView.SeriesTypeLine,
  12.                                                                seriesName,
  13.                                                                chartView.xAxis,
  14.                                                                yAxis)
  15.             for (var i = 0; i < 1000; ++i)
  16.             {
  17.                 series.append(i/5, Math.sin(i/5)/2 + 0.5)
  18.             }
  19.             itemRoot.configurationProxy.registerSeriesAtIndex(series, channelIndex)
  20.  
  21.             lineSeries = series
  22.  
  23.         }
  24.  
  25.         property LineSeries lineSeries
  26.  
  27.         property ValueAxis _yAxis: ValueAxis {
  28.             id: yAxis
  29.             min: itemRoot.fromYValue
  30.             max: itemRoot.toYValue
  31.             gridVisible: false
  32.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement