##// END OF EJS Templates
fine tuning donutbreakdownchart
Jani Honkonen -
r1905:2f36b74b4262
parent child
Show More
@@ -31,10 +31,9 void DonutBreakdownChart::addBreakdownSeries(QPieSeries *breakdownSeries, QColor
31 breakdownSeries->setHoleSize(0.7);
31 breakdownSeries->setHoleSize(0.7);
32 breakdownSeries->setLabelsVisible();
32 breakdownSeries->setLabelsVisible();
33 foreach (QPieSlice *slice, breakdownSeries->slices()) {
33 foreach (QPieSlice *slice, breakdownSeries->slices()) {
34 color = color.lighter(110);
34 color = color.lighter(115);
35 slice->setBrush(color);
35 slice->setBrush(color);
36 slice->setLabelFont(QFont("Arial", 8));
36 slice->setLabelFont(QFont("Arial", 8));
37 slice->setLabelArmLengthFactor(0.05);
38 }
37 }
39
38
40 // add the series to the chart
39 // add the series to the chart
@@ -13,23 +13,23 int main(int argc, char *argv[])
13 // Data from http://www.stat.fi/til/ekul/2010/ekul_2010_2011-12-13_tie_001_en.html
13 // Data from http://www.stat.fi/til/ekul/2010/ekul_2010_2011-12-13_tie_001_en.html
14
14
15 QPieSeries *series1 = new QPieSeries();
15 QPieSeries *series1 = new QPieSeries();
16 series1->setName("Fossil");
16 series1->setName("Fossil fuels");
17 series1->append("Oil", 353295);
17 series1->append("Oil", 353295);
18 series1->append("Wood", 319663);
19 series1->append("Coal", 188500);
18 series1->append("Coal", 188500);
20 series1->append("Natural gas", 148680);
19 series1->append("Natural gas", 148680);
21 series1->append("Peat", 94545);
20 series1->append("Peat", 94545);
22
21
23 QPieSeries *series2 = new QPieSeries();
22 QPieSeries *series2 = new QPieSeries();
24 series2->setName("Renewable");
23 series2->setName("Renewables");
24 series2->append("Wood fuels", 319663);
25 series2->append("Hydro power", 45875);
25 series2->append("Hydro power", 45875);
26 series2->append("Wind power", 1060);
26 series2->append("Wind power", 1060);
27
27
28 QPieSeries *series3 = new QPieSeries();
28 QPieSeries *series3 = new QPieSeries();
29 series3->setName("Other");
29 series3->setName("Others");
30 series3->append("Nuclear energy", 238789);
30 series3->append("Nuclear energy", 238789);
31 series3->append("Import energy", 37802);
31 series3->append("Import energy", 37802);
32 series3->append("Others", 32441);
32 series3->append("Other", 32441);
33 //![1]
33 //![1]
34
34
35 //![2]
35 //![2]
General Comments 0
You need to be logged in to leave comments. Login now