Results 1 to 5 of 5

Thread: multiple lines on a chart

  1. #1
    Ext User
    Join Date
    Oct 2009
    Posts
    16

    Default multiple lines on a chart

    I have a line graph, and I wish to add a single line(eg. average line) to the graph. I know you can add another series, but I have to add an extra field with identical value to all my data points if i want to do it this way.
    Is there a better way?

  2. #2
    Sencha User MiamiCoder's Avatar
    Join Date
    Mar 2009
    Location
    Miami, FL
    Posts
    144

    Default

    Don't waste cycles looking for an optimizing solution for this when a satisficing solution will do. You can always come back and optimize if needed.

  3. #3
    Ext User
    Join Date
    Oct 2009
    Posts
    16

    Default

    true, but if I emulate a straight line graph by many points of the same y value, how do I remove the points so it looks like a straight line.

  4. #4
    Sencha User MiamiCoder's Avatar
    Join Date
    Mar 2009
    Location
    Miami, FL
    Posts
    144

    Default

    You could use a transparent image as the data point, for example:
    Code:
    series: [{
     type: 'line',
     displayName: 'Movies',
     yField: 'movies',
     style: {
       color: 0xCCCCCC,
       image: Ext.BLANK_IMAGE_URL
     }
    }]

  5. #5
    Sencha User MiamiCoder's Avatar
    Join Date
    Mar 2009
    Location
    Miami, FL
    Posts
    144

    Default

    Or, change the color, alpha, fillColor and fillAlpha to achieve transparency:
    Code:
    series: [{
      type: 'line',
      displayName: 'Average',
      yField: 'average',
      style: {
         color: 0xCCCCCC,
         alpha:0,
         fillColor: 0xCCCCCC, 
         fillAlpha:0
      }
    }]
    Last edited by MiamiCoder; 15 Mar 2010 at 5:26 AM. Reason: Fixed typo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •