简体   繁体   English

VISIBLOX,WPF:获取图表点以水平滚动?

[英]VISIBLOX, WPF: Getting chart points to scroll horizontally?

I'm using the Visiblox WPF API and am having trouble getting the chart points in my line chart to scroll horizontally. 我正在使用Visiblox WPF API并且无法在折线图中获取图表点以水平滚动。 Instead of scrolling, the points are get squashed together, in which, this isn't particularly a problem, except that I expect to have 100s of data points on the chart. 而不是滚动,点被压扁在一起,其中,这不是特别的问题,除了我期望在图表上有100个数据点。 I have looked throughout the examples available on the Visiblox website, but couldn't find what I was looking for. 我查看了Visiblox网站上的所有示例,但找不到我想要的内容。 Ive attached an example screenshot. 我附上了一个示例截图。

Any ideas? 有任何想法吗?

Thanks for your help, Sparky 谢谢你的帮助,Sparky

例

By default Visiblox Charts will re-calculate the range to include all the data in the series, so there are two possible approaches: 1) when you add the last point, remove the first one which will effectively move the visible window one point over or 2) set an explicit axis range and update that when you want to move the visible window. 默认情况下,Visiblox图表将重新计算范围以包括系列中的所有数据,因此有两种可能的方法:1)当您添加最后一个点时,删除第一个将有效移动可见窗口一个点或2)设置显式轴范围,并在想要移动可见窗口时更新。

Check out the Visiblox blog for more details on how ranges work at: http://www.visiblox.com/blog/2011/03/visiblox-charts-ranges-demystified 查看Visiblox博客,了解有关范围如何工作的更多详细信息: http//www.visiblox.com/blog/2011/03/visiblox-charts-ranges-demystified

I just had something like this recently. 我最近才有这样的事情。 Everytime I'd add a point to the cart I'd run a little section of code that would check the amount of time (my x-axis dimension) that had passed since 0. I also set up a range of data I always wanted to see. 每当我向购物车添加一个点时,我会运行一小段代码来检查从0开始经过的时间量(我的x轴尺寸)。我还设置了一系列我一直想要的数据查看。 I always wanted to show 120 seconds of data on the graph. 我一直想在图表上显示120秒的数据。 So I had something like this: 所以我有这样的事情:

private void adjustXasis(int timeCount)
{
    if(timeCount>desiredRange)
    {
        chart.axis.Xaxis.minimum=timeCount-desiredRange;
        chart.axis.Xaxis.maximum=timeCount;
    }
    else //two minutes not reached yet
    {
        chart.axis.Xaxis.minimum=0;
        chart.axis.Xaxis.maximum=desiredRange;
    }           
}

I don't have VS in front of me and I know that syntax for the axis min/max is wrong but you get the idea. 我没有在我面前的VS,我知道轴min / max的语法是错误的,但你明白了。

By default Visiblox Charts will re-calculate the range to include all the data in the series, so there are two possible approaches: 1) when you add the last point, remove the first one which will effectively move the visible window one point over or 2) set an explicit axis range and update that when you want to move the visible window. 默认情况下,Visiblox图表将重新计算范围以包括系列中的所有数据,因此有两种可能的方法:1)当您添加最后一个点时,删除第一个将有效移动可见窗口一个点或2)设置显式轴范围,并在想要移动可见窗口时更新。

Check out the Visiblox blog for more details on how ranges work at: http://www.visiblox.com/blog/2011/03/visiblox-charts-ranges-demystified 查看Visiblox博客,了解有关范围如何工作的更多详细信息: http//www.visiblox.com/blog/2011/03/visiblox-charts-ranges-demystified

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM