我可以有一个同时包含绘图和线条的弹性图表吗?

发布于 2024-10-30 19:10:30 字数 92 浏览 0 评论 0原文

Flex 有一个绘图组件和一个折线图组件。但我希望制作一个图表,其中包含连接点的线以及带有翻转信息的较大点。这容易实现吗?我是否必须从头开始创建自定义组件才能实现此目的?

Flex has a plotchart component and a linechart component.. but I am looking to make a chart that has lines connecting points as well as larger dots with rollover info. Is this easily possible? Would I have to create a custom component from scratch to achieve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

淡忘如思 2024-11-06 19:10:30

看起来您需要的是带有 itemRenderer 的 LineChart,而不是混合类型图表。

查看在 Flex 折线图中显示数据点

It looks like what you need is a LineChart with itemRenderer rather than a mixed type chart.

Have a look at Displaying data points in Flex Line chart

岛歌少女 2024-11-06 19:10:30

如果我理解正确的话,您需要一个具有多个系列、不同显示类型的图表。这在 Flex 中很容易做到。 这篇关于多系列图表的文章应该可以帮助您入门。

如果您需要 Flex 3,请尝试这篇文章。

这是一个非常基本的绘图+折线图示例。它一点也不漂亮,但它可能会让您了解如何开始。

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    <fx:Declarations>
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            [Bindable]
            private var plotData:ArrayCollection = new ArrayCollection([
                {xVal: 1, yVal: 5},
                {xVal: 2, yVal: 10},
                {xVal: 3, yVal: 15}
            ]);

            [Bindable]
            private var lineData:ArrayCollection = new ArrayCollection([
                {xVal: 1, yVal: 4},
                {xVal: 2, yVal: 1},
                {xVal: 3, yVal: 10}
            ]);
        ]]>
    </fx:Script>
    <mx:LineChart id="myChart"
                  showDataTips="true"
                  height="250"
                  width="350">
        <mx:horizontalAxis>
            <mx:LinearAxis minimum="0" maximum="20" />
        </mx:horizontalAxis>
        <mx:verticalAxis>
            <mx:LinearAxis minimum="0" maximum="20" />
        </mx:verticalAxis>
        <mx:series>
            <mx:PlotSeries
                dataProvider="{plotData}"
                xField="xVal"
                yField="yVal">
            </mx:PlotSeries>
            <mx:LineSeries
                dataProvider="{lineData}"
                xField="xVal"
                yField="yVal">
            </mx:LineSeries>
        </mx:series>
    </mx:LineChart>
</s:Application>

If I understand you correctly, you want a chart with multiple series, of different display types. This is pretty easy to do in Flex. This article on multiple-series charts should get you started.

If you need Flex 3, try this article.

Here is a very basic example of a plot+line chart. It's not pretty at all, but it might give you an idea of how to get going.

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    <fx:Declarations>
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            import mx.collections.ArrayCollection;
            [Bindable]
            private var plotData:ArrayCollection = new ArrayCollection([
                {xVal: 1, yVal: 5},
                {xVal: 2, yVal: 10},
                {xVal: 3, yVal: 15}
            ]);

            [Bindable]
            private var lineData:ArrayCollection = new ArrayCollection([
                {xVal: 1, yVal: 4},
                {xVal: 2, yVal: 1},
                {xVal: 3, yVal: 10}
            ]);
        ]]>
    </fx:Script>
    <mx:LineChart id="myChart"
                  showDataTips="true"
                  height="250"
                  width="350">
        <mx:horizontalAxis>
            <mx:LinearAxis minimum="0" maximum="20" />
        </mx:horizontalAxis>
        <mx:verticalAxis>
            <mx:LinearAxis minimum="0" maximum="20" />
        </mx:verticalAxis>
        <mx:series>
            <mx:PlotSeries
                dataProvider="{plotData}"
                xField="xVal"
                yField="yVal">
            </mx:PlotSeries>
            <mx:LineSeries
                dataProvider="{lineData}"
                xField="xVal"
                yField="yVal">
            </mx:LineSeries>
        </mx:series>
    </mx:LineChart>
</s:Application>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文