Skip to content

Commit

Permalink
Replaced this pointer with the Canvas id and changed the import to Qt…
Browse files Browse the repository at this point in the history
…Quick 2.0, to make it work on Qt 5.0.
  • Loading branch information
zacura committed Mar 22, 2014
1 parent c97c670 commit baa60cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions QChart.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
*/

import QtQuick 2.2
import QtQuick 2.0

import "QChart.js" as Charts

Expand All @@ -39,22 +39,22 @@ Canvas {

switch(chartType) {
case Charts.ChartType.BAR:
chart = new Charts.Chart(this, this.getContext("2d")).Bar(chartData);
chart = new Charts.Chart(canvas, canvas.getContext("2d")).Bar(chartData);
break;
case Charts.ChartType.DOUGHNUT:
chart = new Charts.Chart(this, this.getContext("2d")).Doughnut(chartData);
chart = new Charts.Chart(canvas, canvas.getContext("2d")).Doughnut(chartData);
break;
case Charts.ChartType.LINE:
chart = new Charts.Chart(this, this.getContext("2d")).Line(chartData);
chart = new Charts.Chart(canvas, canvas.getContext("2d")).Line(chartData);
break;
case Charts.ChartType.PIE:
chart = new Charts.Chart(this, this.getContext("2d")).Pie(chartData);
chart = new Charts.Chart(canvas, canvas.getContext("2d")).Pie(chartData);
break;
case Charts.ChartType.POLAR:
chart = new Charts.Chart(this, this.getContext("2d")).PolarArea(chartData);
chart = new Charts.Chart(canvas, canvas.getContext("2d")).PolarArea(chartData);
break;
case Charts.ChartType.RADAR:
chart = new Charts.Chart(this, this.getContext("2d")).Radar(chartData);
chart = new Charts.Chart(canvas, canvas.getContext("2d")).Radar(chartData);
break;
default:
console.log('Chart type should be specified.');
Expand Down
2 changes: 1 addition & 1 deletion QChartGallery.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*
*/

import QtQuick 2.2
import QtQuick 2.0

import "."
import "QChart.js" as Charts
Expand Down

0 comments on commit baa60cd

Please sign in to comment.