彩票走势图

高性能图表控件LightningChart中3D视图问题解答

翻译|使用教程|编辑:杨鹏连|2021-04-13 13:15:49.973|阅读 149 次

概述:本文主要介绍了高性能图表控件LightningChart 中3D视图问题(ArgumentOutOfRangeException)解答。

# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>

相关链接:

LightningChart.NET完全由GPU加速,并且性能经过优化,可用于实时显示海量数据-超过10亿个数据点。 LightningChart包括广泛的2D,高级3D,Polar,Smith,3D饼/甜甜圈,地理地图和GIS图表以及适用于科学,工程,医学,航空,贸易,能源和其他领域的体绘制功能。

LightningChart.NET现已加入在线订购,SignalTools , 12 months, WPF版本原价4105元,现价只需3499元,现在抢购立享优惠!立即购买>>

点击下载LightningChart.NET最新试用版  LightningChart JS最新试用版  

:想创建这样的3D图形衍生函数图像,但是却出现System.ArgumentOutOfRangeException问题,有什么错误?

void __3d(vector<int>y) { 
lightningChartUltimate1 = gcnew LightningChartUltimate(); 

lightningChartUltimate1->BeginUpdate(); 
cli::array<SeriesPoint3D>^ points = gcnew cli::array<SeriesPoint3D>(y.size()); 
for (size_t i = 0; i < y.size()-1; i++) { 
points[i].X = i * 0.2; 
points[i].Y = y[i + 1] - y[i]; 
points[i].Z = i * 0.2; 
} 
lightningChartUltimate1->View3D->PointLineSeries3D[0]->Points = points; //System.ArgumentOutOfRangeException:Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index 
lightningChartUltimate1->EndUpdate();                                     
}
回复:需要创建PointLineSeries3D对象并将其添加到集合View3D-> PointLineSeries3D,因为最初的集合为空。

3D图表Winforms C ++示例一样发布了它

void __3dchart(vector<int> y)
{
chart3d->BeginUpdate();
chart3d->Parent = tabControl1->TabPages[1];
chart3d->Name = "3D line plot";
chart3d->ActiveView = ActiveView::View3D;
//create Series obj
auto series = gcnew PointLineSeries3D(chart3d->View3D, Axis3DBinding::Primary, Axis3DBinding::Primary, Axis3DBinding::Primary);
series->PointStyle->Shape3D = PointShape3D::Sphere;
series->PointStyle->Size3D->SetValues(1, 1, 1);
series->Material->DiffuseColor = Color::Navy;
series->Material->SpecularColor = Color::Red;
series->Material->SpecularPower = 20;
series->LineVisible = true;
series->LineStyle->AntiAliasing = LineAntialias::Normal;
series->LineStyle->Color = Color::FromArgb(100, Color::Red);
series->LineStyle->Width = 0.2f;
series->LineStyle->LineOptimization = LineOptimization::NormalWithShading;
series->PointsVisible = false;
chart3d->View3D->PointLineSeries3D->Add(series);//add series

auto series1 = chart3d->View3D->PointLineSeries3D[0];
        series1->Clear();//clear for new  points
cli::array<SeriesPoint3D> ^ points = gcnew cli::array<SeriesPoint3D>(y.size()); 
vector<double> yz;//for max min XYZ correction
for (size_t i = 0; i < y.size() - 1;i++) {
points[i].X = points[i].Z = i*0.2;
double v = points[i].Y =  y[i+1] - y[i];
yz.push_back(v); 
}
//XYZ correction
chart3d->View3D->YAxisPrimary3D->Maximum = *std::max_element(std::begin(yz), std::end(yz));
chart3d->View3D->YAxisPrimary3D->Minimum = *std::min_element(std::begin(yz), std::end(yz));
chart3d->View3D->XAxisPrimary3D->Maximum = yz.size()*0.2;//maxX
chart3d->View3D->ZAxisPrimary3D->Maximum = yz.size()*0.2;//maxZ

series1->Points = points;
chart3d->EndUpdate();
}

如果对此有任何疑问,以获取更多信息。

想要购买LightningChart正版授权,或了解更多产品信息请点击


标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@pclwef.cn

文章转载自:

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP