没有找到合适的产品?
联系客服协助选型:023-68661681
提供3000多款全球软件/控件产品
针对软件研发的各个阶段提供专业培训与技术咨询
根据客户需求提供定制化的软件开发服务
全球知名设计软件,显著提升设计质量
打造以经营为中心,实现生产过程透明化管理
帮助企业合理产能分配,提高资源利用率
快速打造数字化生产线,实现全流程追溯
生产过程精准追溯,满足企业合规要求
以六西格玛为理论基础,实现产品质量全数字化管理
通过大屏电子看板,实现车间透明化管理
对设备进行全生命周期管理,提高设备综合利用率
实现设备数据的实时采集与监控
利用数字化技术提升油气勘探的效率和成功率
钻井计划优化、实时监控和风险评估
提供业务洞察与决策支持实现数据驱动决策
翻译|使用教程|编辑:黄竹雯|2018-12-18 09:49:14.000|阅读 841 次
概述:Web图表控件ChartDirector连载教程分享之盒须图,内附下载和链接。
# 界面/图表报表/文档/IDE等千款热门软控件火热销售中 >>
相关链接:
ChartDirector是一个非常理想的图表工具,它拥有广泛的图表类型、分层架构、实时互动的大数据表、普遍适应于各种应用程序以及支持PDF和SVG图标等的优点。此系列连载旨在介绍ChartDirector的实用教程,供大家学习讨论。

此示例演示了如何创建盒须图。标准盒须图使用盒须符号可以绘制最多5个数据集。这5个数据集尽管可以表示任何类型的量,但他们一般被称为最大值、四分之三值、中间值、四分之一值和最小值。
在盒须符号中,四分之三和四分之一值表示方框。最大值、最小值和中间值表示水平标记。其中有一条垂直线连接最大值和最小值。 在ChartDirector中,XYChart.addBoxWhiskerLayer和XYChart.addBoxWhiskerLayer2可用于创建单色和多色盒须层。
创建盒须层时,不需要存在所有5个数据集。一种常见用法是仅提供四分之三和四分之一值的数据(将其他参数保留为空数组),以此仅绘制图表的“Box”部分,形成浮动框图。另一种常见用法是仅提供最大值和最小值以仅绘制图表的“Whisker”部分,它们可用作“error symbols”。您甚至可以仅提供中间值数据来绘制浮动标记线。
以下代码可在“cppdemo/simplebar”中找到。MFC版本的代码可在“mfcdemo / mfcdemo”中找到(仅限Windows版本)。QT版本的代码可在“qtdemo/qtdemo”中找到。
#include "chartdir.h"
int main(int argc, char *argv[])
{
// Sample data for the Box-Whisker chart. Represents the minimum, 1st quartile, medium, 3rd
// quartile and maximum values of some quantities
double Q0Data[] = {40, 45, 40, 30, 20, 50, 25, 44};
double Q1Data[] = {55, 60, 50, 40, 38, 60, 51, 60};
double Q2Data[] = {62, 70, 60, 50, 48, 70, 62, 70};
double Q3Data[] = {70, 80, 65, 60, 53, 78, 69, 76};
double Q4Data[] = {80, 90, 75, 70, 60, 85, 80, 84};
// The labels for the chart
const char *labels[] = {"Group A", "Group B", "Group C", "Group D", "Group E", "Group F",
"Group G", "Group H"};
// Create a XYChart object of size 550 x 250 pixels
XYChart *c = new XYChart(550, 250);
// Set the plotarea at (50, 25) and of size 450 x 200 pixels. Enable both horizontal and
// vertical grids by setting their colors to grey (0xc0c0c0)
c->setPlotArea(50, 25, 450, 200)->setGridColor(0xc0c0c0, 0xc0c0c0);
// Add a title to the chart
c->addTitle("Computer Vision Test Scores");
// Set the labels on the x axis and the font to Arial Bold
c->xAxis()->setLabels(StringArray(labels, (int)(sizeof(labels) / sizeof(labels[0])))
)->setFontStyle("arialbd.ttf");
// Set the font for the y axis labels to Arial Bold
c->yAxis()->setLabelStyle("arialbd.ttf");
// Add a Box Whisker layer using light blue 0x9999ff as the fill color and blue (0xcc) as the
// line color. Set the line width to 2 pixels
c->addBoxWhiskerLayer(DoubleArray(Q3Data, (int)(sizeof(Q3Data) / sizeof(Q3Data[0]))),
DoubleArray(Q1Data, (int)(sizeof(Q1Data) / sizeof(Q1Data[0]))), DoubleArray(Q4Data, (int)(
sizeof(Q4Data) / sizeof(Q4Data[0]))), DoubleArray(Q0Data, (int)(sizeof(Q0Data) / sizeof(
Q0Data[0]))), DoubleArray(Q2Data, (int)(sizeof(Q2Data) / sizeof(Q2Data[0]))), 0x9999ff,
0x0000cc)->setLineWidth(2);
// Output the chart
c->makeChart("boxwhisker.png");
//free up resources
delete c;
return 0;
}

此示例扩展了盒须图(一)的示例,演示了控制图表外观的各种方法,包括使用不同的颜色和不同的字体大小,以及使用渐变着色和圆角的方法。
以下代码可在“cppdemo/simplebar”中找到。MFC版本的代码可在“mfcdemo / mfcdemo”中找到(仅限Windows版本)。QT版本的代码可在“qtdemo/qtdemo”中找到。
#include "chartdir.h"
int main(int argc, char *argv[])
{
// Sample data for the Box-Whisker chart. Represents the minimum, 1st quartile, medium, 3rd
// quartile and maximum values of some quantities
double Q0Data[] = {40, 45, 40, 30, 20, 50, 25, 44};
double Q1Data[] = {55, 60, 50, 40, 38, 60, 51, 60};
double Q2Data[] = {62, 70, 60, 50, 48, 70, 62, 70};
double Q3Data[] = {70, 80, 65, 60, 53, 78, 69, 76};
double Q4Data[] = {80, 90, 75, 70, 60, 85, 80, 84};
// The labels for the chart
const char *labels[] = {"A", "B", "C", "D", "E", "F", "G", "H"};
// Create a XYChart object of size 450 x 400 pixels
XYChart *c = new XYChart(450, 400);
// Set the plotarea at (50, 30) and of size 380 x 340 pixels, with transparent background and
// border and light grey (0xcccccc) horizontal grid lines
c->setPlotArea(50, 30, 380, 340, Chart::Transparent, -1, Chart::Transparent, 0xcccccc);
// Add a title box using grey (0x555555) 18pt Arial font
TextBox *title = c->addTitle(" Pattern Recognition Accuracy", "arial.ttf", 18, 0x555555);
// Set the x and y axis stems to transparent and the label font to 12pt Arial
c->xAxis()->setColors(Chart::Transparent);
c->yAxis()->setColors(Chart::Transparent);
c->xAxis()->setLabelStyle("arial.ttf", 12);
c->yAxis()->setLabelStyle("arial.ttf", 12);
// Set the labels on the x axis
c->xAxis()->setLabels(StringArray(labels, (int)(sizeof(labels) / sizeof(labels[0]))));
// For the automatic y-axis labels, set the minimum spacing to 30 pixels.
c->yAxis()->setTickDensity(30);
// Add a box whisker layer using light blue (0x99ccee) for the fill color and blue (0x6688aa)
// for the whisker color. Set line width to 2 pixels. Use rounded corners and bar lighting
// effect.
BoxWhiskerLayer *b = c->addBoxWhiskerLayer(DoubleArray(Q3Data, (int)(sizeof(Q3Data) / sizeof(
Q3Data[0]))), DoubleArray(Q1Data, (int)(sizeof(Q1Data) / sizeof(Q1Data[0]))), DoubleArray(
Q4Data, (int)(sizeof(Q4Data) / sizeof(Q4Data[0]))), DoubleArray(Q0Data, (int)(sizeof(Q0Data)
/ sizeof(Q0Data[0]))), DoubleArray(Q2Data, (int)(sizeof(Q2Data) / sizeof(Q2Data[0]))),
0x99ccee, 0x6688aa);
b->setLineWidth(2);
b->setRoundedCorners();
b->setBorderColor(Chart::Transparent, Chart::barLighting());
// Adjust the plot area to fit under the title with 10-pixel margin on the other three sides.
c->packPlotArea(10, title->getHeight(), c->getWidth() - 10, c->getHeight() - 10);
// Output the chart
c->makeChart("boxwhisker2.png");
//free up resources
delete c;
return 0;
}
本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@fz165y.cn




在使用Parasoft C/C++test执行BugDetective数据流分析时,可能会遇到用户自定义的资源API,那在这种情况下,若要判断是否存在资源问题,如资源泄露等,则需要手动配置测试配置。
大型SaaS系统的自动化测试常常受制于界面变化快、结构复杂、加载机制多变等因素。从元素识别到脚本管理,SmartBear TestComplete帮助Salesforce建了可靠的自动化测试体系。
BarTender 标签管理系统,正是帮助企业轻松实现 GS1 标准化标签设计、编码生成与信息联动的强大工具。
Parasoft C/C++test 是一款功能强大的 C/C++ 软件测试工具,集成了静态代码分析、单元测试、集成测试和覆盖率分析等功能,单元测试作为其关键功能之一,为了适配多样化的目标部署环境,C/C++test 设计了灵活的测试结果收集机制。通过Socket通讯方式来收集单元测试结果,从而扩展其测试覆盖范围与应用场景。
服务电话
重庆/ 023-68661681
华东/ 13452821722
华南/ 18100878085
华北/ 17347785263
客户支持
技术支持咨询服务
服务热线:400-700-1020
邮箱:sales@fz165y.cn
关注我们
地址 : 重庆市九龙坡区火炬大道69号6幢
星空最火知名网站