0 Replies Latest reply on Nov 16, 2009 1:25 PM by joeheyming

    Is there a way to plot discrete line segments within the same data series without connecting the segments?

    joeheyming

      This is what I have...

      whatIhave.jpg

      This is what I want:

      whatIwant.jpg

       

      Here is my code:

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
          <mx:Script>
              <![CDATA[         
              import mx.collections.ArrayCollection;

       

           
              [Bindable]
              private var thread2:ArrayCollection = new ArrayCollection( [
                  { Time: 1, Value: 4 },
                  { Time: 6, Value: 4 },
                 
                  { Time: 10, Value: 20 },
                  { Time: 15, Value: 20 },                       
                  ]);
              ]]>
          </mx:Script>

       

          <!-- Define custom colors for use as fills. -->
          <mx:SolidColor id="sc1" color="yellow" alpha=".8"/>

       

          <!-- Define custom Strokes for the columns. -->
          <mx:Stroke id="s1" color="yellow" weight="2"/>

       

          <mx:Panel title="ColumnChart and BarChart Controls Example"
              height="100%" width="100%" layout="horizontal">
              <mx:LineChart id="column"
                  height="100%"
                  width="100%"
                  paddingLeft="5"
                  paddingRight="5"
                  showDataTips="true"
                 
                   >

       

                  <mx:horizontalAxis>
                      <mx:LinearAxis />
                  </mx:horizontalAxis>

       

                  <mx:verticalAxis>
                      <mx:LinearAxis  />            
                  </mx:verticalAxis>

       

                  <mx:series>
                  
                      <mx:LineSeries
                          xField="Time"
                          yField="Value"
                        
                          displayName="thread2"
                          dataProvider="{thread2}"
                          interpolateValues="false"
                         
                         
                         
                         
                      />
                  </mx:series>

       

              </mx:LineChart>

       

          </mx:Panel>
      </mx:Application>

       

      also, I want to be able to plot segments above each other.  For example: Lines {(1,2),(10,2)},  and {(1,5),(6,5)} would show two separate lines.  For some reason, the charting only shows one line.

       

      Thanks in advanced.