Hitachi Vantara Pentaho Community Forums
Results 1 to 4 of 4

Thread: How to adjust the baseAxis Grid Line chart pentaho cde

  1. #1
    Join Date
    Aug 2013
    Posts
    3

    Question How to adjust the baseAxis Grid Line chart pentaho cde

    hi,

    I have a line chart and i want the base axis grid lines to be in-line with base axis ticks. But the grid lines are coming in between the ticks. What option/extension point do I need to change? Please help.

  2. #2
    Join Date
    Mar 2012
    Posts
    645

    Default

    You're not using a continuous base axis.
    In discrete axes, grid-lines are shown separating the category bands. The ticks show in the center of the band.
    So, can this mean that what you really wanted is a continuous scale?

    Apart from that, I've setup a fiddle that shows how to do this with a discrete axis.
    Essentially, we just need to override the "left" property of the grid rules, offsetting them by half the width of each band.

  3. #3
    Join Date
    Aug 2013
    Posts
    3

    Default

    hi duarte,
    Thanks for your response.
    Actually I am new to the Pentaho Cde.

    Could you please tell me how can I assign the javascript functions to the extension points baseAxisGrid_visible and baseAxisGrid_left.

    Values for other extension points I could assign in the user console (Line chart component -> Advanced Properties -> Extension Points)
    extensionPoints: {
    baseAxisGrid_visible: function(scene) {
    return this.index > 0;
    },
    baseAxisGrid_left: function(scene) {
    var halfStep = this.sign._halfStep;
    if(halfStep == null) {
    var scale = this.panel.axes.base.scale;
    halfStep = this.sign._halfStep = scale.range().step/2;
    }

    return this.delegate() - halfStep;
    },
    baseAxisLabel_textAngle: -Math.PI/2,
    baseAxisLabel_textAlign: 'right',
    baseAxisLabel_textBaseline: 'middle'
    }

  4. #4
    Join Date
    Mar 2012
    Posts
    645

    Default

    Hi schez.

    You can also add "function extension points" in the "Advanced Properties > Extension Points" property. Yet, they're hard to maintain there.
    So you have two options.
    i) Specify the extension points directly in code, in the "postFetch" property, for example; read more here.
    ii) Place the multi-line extension point functions in a dashboard resource file, and call these from another one-liner in the "Advanced Properties > Extension Points" extension point property: « function(scene) { return myFun.call(this, scene); } ». If you print the chart with CGG, you'll have to make sure to explicitly include the resource file when in CGG, so the first option is a bit easier to accomplish.

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.