diff --git a/examples/iot-dashboard/UsageDiagram.cpp b/examples/iot-dashboard/UsageDiagram.cpp index 6a2c4519..34e772c0 100644 --- a/examples/iot-dashboard/UsageDiagram.cpp +++ b/examples/iot-dashboard/UsageDiagram.cpp @@ -73,9 +73,9 @@ UsageDiagram::UsageDiagram( QQuickItem* parent ) int number = 100; std::vector< std::vector > yValues = { - {70, 80, 60, 50, 40, 50, 75, 80, 100, 90, 60, 50}, - {30, 15, 70, 40, 60, 10, 90, 20, 40, 45, 50, 70}, - {10, 70, 40, 60, 10, 70, 20, 50, 20, 30, 40, 80} + {40, 55, 60, 50, 40, 50, 75, 80, 100, 90}, + {30, 15, 30, 40, 60, 10, 70, 20, 40, 45}, + {60, 45, 60, 70, 10, 70, 20, 50, 20, 30} }; for( int i = 0; i < 3; ++i ) @@ -91,9 +91,15 @@ UsageDiagram::UsageDiagram( QQuickItem* parent ) for( int x = 0; x < number; ++x ) { const qreal y = spline( x ); - dataPoints.append( QPointF( x, qBound( 0.0, y, 100.0 ) ) ); + QPointF p( x, qBound( 0.0, y, 100.0 ) ); + + printf( "%.2f, ", y ); + + dataPoints.append( p ); } + printf( "\n" ); + m_diagram->addDataPoints( dataPoints, Diagram::Area ); }