QSint Charts

Qt Widgets

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

0
Score 58.0%
Description:

BarChartPlotter is a simple Bar Chart plotting widget.

This is a technical preview only - BarChartPlotter will be included into QSint::Charts library.

BarChartPlotter provides easy-to-use API and performs fast "native" painting (directly via QPainter).

Currently it allows to draw Bar Charts of 2 types: Stacked and Column.

BarChartPlotter follows MVC ideology using QAbstractItemModel as data source.

Karbofos

7 years ago

Hello!
Many thanks for this project. :)
My question: i try to colorize the separate items of the chart, for example:

itemModel->setData(itemModel->index(i, j), Qt::red, Qt::BackgroundRole);

or
itemModel->setData(itemModel->index(i, j), Qt::blue, Qt::ForegroundRole);

and the objects are not colorized. what is wrong?
thank you!

Report

Karbofos

7 years ago

all right, i solved it.
replaced in BarChartPlotter::drawContent

// QPen pen(qvariant_cast<QColor>(m_model->headerData(j, Qt::Vertical, Qt::ForegroundRole)));
// QBrush brush(qvariant_cast<QBrush>(m_model->headerData(j, Qt::Vertical, Qt::BackgroundRole)));
QPen pen(qvariant_cast<QColor>(m_model->data(m_model->index(j,i), Qt::ForegroundRole)));
QBrush brush(qvariant_cast<QBrush>(m_model->data(m_model->index(j,i), Qt::BackgroundRole)));

this solution i need for colorized displaing of percent information, f. ex: about 35% is red and so on

Report

12345678910
1
product-maker Karbofos Aug 02 2012 9 excellent
product-maker Count: 4 Rating: 5.0
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs ocs-url or ocs-store to install things
Pling
Details
license
version
0.1.1
updated Mar 24 2011
added Mar 20 2011
downloads 24h
0
page views 24h 1
System Tags