Hitachi Vantara Pentaho Community Forums
Results 1 to 6 of 6

Thread: Line chart - Third series to be dashed

  1. #1
    Join Date
    Jan 2012
    Posts
    21

    Default Line chart - Third series to be dashed

    I have a line chart with three series, and I want the third series to have dashed line insted of solid. I know how to implement dashed lines on all series using line_strokeDasharray in extension point, but do anyone know how to specify it for a specific series?

  2. #2
    Join Date
    Mar 2012
    Posts
    645

    Default

    Hi,

    instead of specifying a constant extension point, you specify a dynamic one:

    Code:
    line_strokeDasharray: function() {
       // a) By series value
       return this.getSeries() === "2005" ? '-.' : null;
    
       // b) By series index
       return this.scene.parent.childIndex() === 2 ? '-.' : null;
    }

  3. #3
    Join Date
    Jan 2012
    Posts
    21

    Default

    Thanks a lot duarte,

    got it working with

    Code:
    line_strokeDasharray: function () {
    if(this.scene.parent.childIndex() === 3){
       return '-';} }
    Do you know if it's possible to also get the legend to be dashed?

  4. #4
    Join Date
    Mar 2012
    Posts
    645

    Default

    Yes,

    do similar for the legend rule/dot:

    Code:
    legendRule_strokeDasharray: function() {
        if(this.index === 2) return "-";
    }
    Note that the legend's scene structure is different — the series scenes are the leaf scenes — so this.index can be used (it's the same as this.scene.childIndex()).

  5. #5
    Join Date
    Jan 2012
    Posts
    21

    Default

    Just perfect!

  6. #6
    Join Date
    Apr 2017
    Posts
    12

    Default

    I have i Plot2 Series:- AVG column,i want only the plot2 line to be in dotted way.
    I tried below. it is not working.


    line_strokeDasharray: function fun() { return this.getSeries() === "AVG_COLUMN" ? '-' : null;}

    Please correct where i am going wrong.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.