使用c#或cli/c++在visual studio中的winforms中为图形中的数据点着色或高亮显示
Color or Highlight a data point in graph in winforms in visual studio using c# or cli/c++
我通过从数据库中提取数据,以winform绘制图形。它运行良好。我需要的是,如果某个数据值大于最大值,那么图中的那个点就会变高或变红。我该怎么做?请帮忙。
String^ constring = L"datasource=localhost;port=3306;username=root;password=root;";
MySqlConnection^ conDataBase = gcnew MySqlConnection(constring);
MySqlCommand^ cmdDataBase = gcnew MySqlCommand("select * from `data`.`test`;",conDataBase);
MySqlDataReader^ myReader;
try{
conDataBase->Open();
myReader = cmdDataBase->ExecuteReader();
// MessageBox::Show("Data Inserted");
while(myReader->Read()){
String^ v_datetime;
String^ v_temp;
v_datetime = myReader->GetString("datetime");
v_pressure = myReader->GetInt32("temp").ToString();
String^ status;
if (myReader->GetInt32("temp") > 1000 && myReader->GetInt32("temp") < 50 )
{
status = " Abnormal ";
**// and this point only should be highlited or different color in the graph**
}
else{
status = " Normal";
}
this->label3->Text = status;
this->chart2->Series["Temperature"]->Points->AddXY(v_datetime,myReader->GetInt32("temp"));
// comboBox1->Items->Add(vName);
}
}catch(Exception^ex){
MessageBox::Show(ex->Message);
}
您不能将一个属性添加到表示要绘制的对象的类中吗?在绘制图形时,您可以测试该属性并更改颜色、形状和大小。
相关文章:
- 防止主数据类型C++的隐式转换
- 用于访问容器<T>数据成员的正确 API
- 我可以在视频游戏进入 GPU 之前记录图形数据吗?
- 试图找到一种在OpenCV / BOOST中记录图形数据的方法
- 游戏中图形和物理引擎之间共享数据
- 如何计算图形的可视数据
- 适合大型图形的数据结构
- 如何编写递归函数来计算图形数据结构中的最短路径
- 用 C++ 或 C 绘制图形数据
- 动态添加到图形数据结构中
- 使用c#或cli/c++在visual studio中的winforms中为图形中的数据点着色或高亮显示
- Visual Studio 的图形诊断未捕获任何数据
- 是否有标准的图形数据结构可用于基准测试?
- 一个c++图形数据结构的并发垃圾收集
- 如何加速包含图形数据的文本文件的io/解析
- 在c++(适用于Arduino)中可以编译在数据中生成一个图形文件
- matlab编译器:更新数据到图形窗口
- 使用 boost 的内存映射文件存储图形数据
- 图形数据结构内存管理
- 数据模型,图形库,c++