LimeReport Forum
General Category | Основное => Discussion | Обсуждение => Topic started by: arvind.k@propixtech.com on July 31, 2018, 03:53:22 pm
-
I want to show some data on bar-graph.
Does any graphical template/tool available in lime report ?
-
develop branch contains charts
Another way - create the graph inside your Qt code and export in report
-
Hi,how to export a QCahrtView to the report ,thank u very much
-
cwl Hi!
In the callback data source you can realize something like this:
Copyright by Subst :)
if (tab<m_tabBar->count())
{
QChart *chart=m_groupChartHash[m_tabGroupHash[tab]];
QPixmap pixmap(chart->size().toSize());
QPainter painter;
QByteArray data;
QBuffer buffer(&data);
buffer.open(QIODevice::WriteOnly);
painter.begin(&pixmap);
chartView->render(&painter);
painter.end();
pixmap.save(&buffer,"PNG");
buffer.close();
value=data;
}
else
value=QVariant();
break;
}
-
thank you alex:
i know how to insert a image to the report by using the call back method, the question is the image will distortion when zoom in. so is there any method to solve this problem.
-
Is there any method like this,the chart on pdf is never distortion when zoom in anyhow.
vfchartView->setRenderHint(QPainter::TextAntialiasing);
vfchartView->show();
QPdfWriter writer("chart.pdf");
writer.setPageSize(QPagedPaintDevice::A4);
QPainter painter(&writer);
QRect chartRect = vfchartView->viewport()->rect();
QRect pdfRect = QRect(500, 500, 5000, 5000);
vfchartView->render(&painter, pdfRect, chartRect,Qt::KeepAspectRatio);
-
To draw a diagram without distortion is needed qchart item's wrapper. I'll think about it.
-
Alex , thank you ! Looking forward to your solution.
-
Hi Alex, could current version solve the problem. thank u!