Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/apache-flex/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Actionscript 3 烛台系列线条系列使蜡烛更窄_Actionscript 3_Apache Flex_Charts_Flex4.5_Candlestick Chart - Fatal编程技术网

Actionscript 3 烛台系列线条系列使蜡烛更窄

Actionscript 3 烛台系列线条系列使蜡烛更窄,actionscript-3,apache-flex,charts,flex4.5,candlestick-chart,Actionscript 3,Apache Flex,Charts,Flex4.5,Candlestick Chart,我正在使用Flex4.5。 在我的应用程序中,我有一个带有基本烛台系列的烛台KChart。 我为用户提供了在烛台图表顶部添加线条图的功能,方法是向烛台KChart添加线条系列,如adobe文档中所述: 我的问题是,当添加线时,蜡烛的形状会变窄。此外,每增加一条线都会使蜡烛变得更窄 我环顾四周,在adobe的论坛上发现了这个帖子:它描述了完全相同的问题 不幸的是,这条线索仍然没有得到回答 有人知道这个问题的解决办法吗 提前感谢,, Ravid好吧,我发现的解决方案并不好,更好的解决方案仍然值得赞赏

我正在使用Flex4.5。 在我的应用程序中,我有一个带有基本烛台系列的烛台KChart。 我为用户提供了在烛台图表顶部添加线条图的功能,方法是向烛台KChart添加线条系列,如adobe文档中所述:

我的问题是,当添加线时,蜡烛的形状会变窄。此外,每增加一条线都会使蜡烛变得更窄

我环顾四周,在adobe的论坛上发现了这个帖子:它描述了完全相同的问题

不幸的是,这条线索仍然没有得到回答

有人知道这个问题的解决办法吗

提前感谢,,
Ravid

好吧,我发现的解决方案并不好,更好的解决方案仍然值得赞赏,但对于那些有同样问题的人,这个解决方案对我有效:

出现此问题的原因是蜡烛的默认项目渲染器使用项目的宽度来计算蜡烛的大小,这是有意义的。 问题是,当您添加另一个系列时,会出现一个错误,并且在更改蜡烛之前,该项目的宽度会更改

我的解决方案是创建默认项目渲染器的副本,并根据图形的宽度和希望放置在其中的蜡烛数绘制蜡烛(因此不使用项目的宽度)


它解决了这个问题,但是如果你使用工具提示功能,它会弄乱它相对于蜡烛的位置

我知道这个答案有点晚了,但如果它对其他人有帮助,下面是我所做的。 (它也没有经过彻底测试)

创建一个扩展CandleStickChart类的类,并简单地重写“ApplySriesset”函数,如下所示:

override protected function applySeriesSet(seriesSet:Array /* of Series */,
                                               transform:DataTransform):Array /* of Series */
    {
        // filter out the non-candlestick series
        var filteredSeriesSet:Array = new Array();
        for each(var series:Series in seriesSet){
            if(series is CandlestickSeries) filteredSeriesSet.push(series);
        }

        // call the CandlestickChart applySeriesSet function with the filtered set, ignore return value
        super.applySeriesSet(filteredSeriesSet, transform);

        // do the code that the CartesianChart applySeriesSet function would have done, but with the unfiltered seriesSet 
        // would have preferred to do something like super.super.applySeriesSet(seriesSet, transform);
        var n:int = seriesSet.length;
        for (var i:int = 0; i < n; i++)
        {
            var newSeries:IChartElement = seriesSet[i];
            if (newSeries is Series)
                customizeSeries(Series(seriesSet[i]), i);
        }
        return seriesSet;
    }
覆盖受保护的函数applySeriesSet(serieset:Array/*系列*/,,
transform:DataTransform):数组/*系列*/
{
//过滤掉非烛台系列
var filteredSeriesSet:Array=new Array();
对于每个(var系列:系列中的系列){
如果(系列是烛台系列)过滤器设置推送(系列);
}
//使用过滤集调用CandlestickChart ApplySriesset函数,忽略返回值
super.applySeriesSet(filteredSeriesSet,transform);
//执行CartesianChart ApplySriesset函数将要执行的代码,但使用未过滤的seriesSet
//更愿意做类似super.super.applySeriesSet(seriesSet,transform)的事情;
变量n:int=序列集长度;
对于(变量i:int=0;i