##// END OF EJS Templates
Adds loosenumber algorithm...
Adds loosenumber algorithm * adds loose numbers , natvie numbers * rewrites zoom handling * remove zoom stack since loose numbers takes control * adds number of fractional digits to show

File last commit:

r677:2b967c4f6e8e
r678:e39e59ad9161
Show More
stackedbarchartitem.cpp
102 lines | 2.9 KiB | text/x-c | CppLexer
/ src / barchart / stackedbarchartitem.cpp
sauimone
combined barpresenterbase and barpresenter. renamed barchartpresenters to barchartitems
r666 #include "stackedbarchartitem_p.h"
sauimone
renamed bar.h to bar_p.h
r118 #include "bar_p.h"
sauimone
Floating values to bar charts
r263 #include "barvalue_p.h"
sauimone
Added pen & brush to QBarSet
r214 #include "qbarset.h"
sauimone
added missing example files :)
r96 #include <QDebug>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
Michal Klocek
Refactors chartitem...
r677 StackedBarChartItem::StackedBarChartItem(QBarSeries *series, ChartPresenter *presenter) :
BarChartItem(series,presenter)
sauimone
added missing example files :)
r96 {
}
sauimone
combined barpresenterbase and barpresenter. renamed barchartpresenters to barchartitems
r666 StackedBarChartItem::~StackedBarChartItem()
sauimone
updating drilldown example. Needs some more thinking
r438 {
}
sauimone
combined barpresenterbase and barpresenter. renamed barchartpresenters to barchartitems
r666 void StackedBarChartItem::layoutChanged()
sauimone
added missing example files :)
r96 {
// Scale bars to new layout
// Layout for bars:
sauimone
review fixes. countCategories() -> categoryCount(). countSets -> barsetCount()
r366 if (mSeries->barsetCount() <= 0) {
sauimone
fixed bug in category implementation. model now owns the category and sets
r173 qDebug() << "No sets in model!";
sauimone
added missing example files :)
r96 // Nothing to do.
return;
}
sauimone
review fixes. countCategories() -> categoryCount(). countSets -> barsetCount()
r366 if (mSeries->categoryCount() == 0) {
sauimone
fixed bug in category implementation. model now owns the category and sets
r173 qDebug() << "No categories in model!";
sauimone
prototyping separators with stacked bars
r119 // Nothing to do
return;
}
sauimone
bug fix in bar charts. Crashed, if layout was set before data. Also integrated to test app.
r165 if (childItems().count() == 0) {
sauimone
combined barpresenterbase and barpresenter. renamed barchartpresenters to barchartitems
r666 qDebug() << "WARNING: StackedBarChartItem::layoutChanged called before graphics items are created!";
sauimone
bug fix in bar charts. Crashed, if layout was set before data. Also integrated to test app.
r165 return;
}
sauimone
Fixed layout for barcharts
r473 // Use temporary qreals for accurancy (we might get some compiler warnings... :)
sauimone
moved tooltip to presenter
r288 qreal maxSum = mSeries->maxCategorySum();
sauimone
barchart domain fix
r674 // Domain:
if (mDomainMaxY > maxSum) {
maxSum = mDomainMaxY;
}
sauimone
fixed naming mixup with percent and stacked groups
r105 qreal h = mHeight;
qreal scale = (h / maxSum);
sauimone
fixing layout bug on stacked bar chart
r98 qreal tW = mWidth;
sauimone
review fixes. countCategories() -> categoryCount(). countSets -> barsetCount()
r366 qreal tC = mSeries->categoryCount() + 1;
sauimone
Fixed layout for barcharts
r473 qreal cC = mSeries->categoryCount() * 2 + 1;
mBarWidth = tW / cC;
sauimone
fixing layout bug on stacked bar chart
r98 qreal xStep = (tW/tC);
sauimone
Fixed layout for barcharts
r473 qreal xPos = ((tW/tC) - mBarWidth / 2);
sauimone
fixing layout bug on stacked bar chart
r98
sauimone
Fixed layout for barcharts
r473 int itemIndex(0);
sauimone
review fixes. countCategories() -> categoryCount(). countSets -> barsetCount()
r366 for (int category = 0; category < mSeries->categoryCount(); category++) {
sauimone
fixing layout bug on stacked bar chart
r98 qreal yPos = h;
sauimone
review fixes. countCategories() -> categoryCount(). countSets -> barsetCount()
r366 for (int set=0; set < mSeries->barsetCount(); set++) {
sauimone
moved tooltip to presenter
r288 qreal barHeight = mSeries->valueAt(set, category) * scale;
sauimone
Bug fix for bar presenters. It appears that order of childItems may change. Relying on order caused crash
r256 Bar* bar = mBars.at(itemIndex);
sauimone
added missing example files :)
r96
sauimone
Fixed layout for barcharts
r473 bar->resize(mBarWidth, barHeight);
Tero Ahola
Bar series to use theme base colors. Pie brush minor fix....
r661 bar->setPen(mSeries->barsetAt(set)->pen());
sauimone
review fix: Removed iterator from barseries. Remove const from brush and pen. Renamed setters for tooltip, floating values and separators
r357 bar->setBrush(mSeries->barsetAt(set)->brush());
sauimone
theme interface to barcharts. some minor fixes
r113 bar->setPos(xPos, yPos-barHeight);
sauimone
added missing example files :)
r96 itemIndex++;
sauimone
Some fixes to bar charts. Now bars draw almost correctly
r97 yPos -= barHeight;
sauimone
added missing example files :)
r96 }
sauimone
fixing layout bug on stacked bar chart
r98 xPos += xStep;
sauimone
added missing example files :)
r96 }
sauimone
cleanup on barseries. removed old commented out separator code
r654
sauimone
Floating values to bar charts
r263 // Position floating values
itemIndex = 0;
sauimone
floating value layout fix for barchart
r474 xPos = (tW/tC);
sauimone
review fixes. countCategories() -> categoryCount(). countSets -> barsetCount()
r366 for (int category=0; category < mSeries->categoryCount(); category++) {
sauimone
Floating values to bar charts
r263 qreal yPos = h;
sauimone
review fixes. countCategories() -> categoryCount(). countSets -> barsetCount()
r366 for (int set=0; set < mSeries->barsetCount(); set++) {
sauimone
moved tooltip to presenter
r288 qreal barHeight = mSeries->valueAt(set,category) * scale;
sauimone
Floating values to bar charts
r263 BarValue* value = mFloatingValues.at(itemIndex);
sauimone
better use of gradients in barcharts
r512 QBarSet* barSet = mSeries->barsetAt(set);
value->resize(100,50); // TODO: proper layout for this.
sauimone
updated barchart examples. minor fixes
r276 value->setPos(xPos, yPos-barHeight/2);
sauimone
better use of gradients in barcharts
r512 value->setPen(barSet->floatingValuePen());
sauimone
Floating values to bar charts
r263
sauimone
moved tooltip to presenter
r288 if (mSeries->valueAt(set,category) != 0) {
value->setValueString(QString::number(mSeries->valueAt(set,category)));
sauimone
updated barchart examples. minor fixes
r276 } else {
value->setValueString(QString(""));
}
sauimone
Floating values to bar charts
r263
itemIndex++;
yPos -= barHeight;
}
xPos += xStep;
sauimone
prototyping separators with stacked bars
r119 }
sauimone
added missing example files :)
r96 }
sauimone
combined barpresenterbase and barpresenter. renamed barchartpresenters to barchartitems
r666 #include "moc_stackedbarchartitem_p.cpp"
sauimone
moved tooltip to presenter
r288
sauimone
added missing example files :)
r96 QTCOMMERCIALCHART_END_NAMESPACE