Hitachi Vantara Pentaho Community Forums
Results 1 to 16 of 16

Thread: Feeding table information to a chart?

  1. #1
    Join Date
    Feb 2011
    Posts
    840

    Question Feeding table information to a chart?

    And good night, ladies and gentlemen. I guess this is my first post outside Kettle area here on Pentaho forums.

    I've started to work with CDE for a personal project, but I can't seem to find some basics... I got Parameters running, I got Select Components running, I got Table Component running... but I can't seem to understand how to "feed" that table to a chart. And I've been researching on google for at least the last 3 hours for that.

    Only thing I could find were two tutorial packs that look absolutely amazing, but I currently have no cash (and even worse, no means of paying since I'm out of international credit cards) to afford them. So, I decided to give it a shot and ask around here - since the Pentaho community already taught me much on using Kettle, couldn't hurt to try here.

    So, layout is coming fine, datasource is working okay, and all components - except for the chart - are amazing already. I defined the chart's name, title, datasource, parameters, listeners... and only title shows up. The datasource outputs a simple SQL table with 3 columns (date, type and value).

    I built a prototype on Excel, and I'm looking for a way to replicate it on Pentaho. Kinda like this...
    Name:  example.png
Views: 1405
Size:  10.6 KB
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

  2. #2
    Join Date
    Mar 2012
    Posts
    645

    Default

    Hi,

    I think you have to provide the chart with the same "data source" property as the table.

    As for the chart, if it is made with CCC, check this very similar one: http://www.webdetails.pt/ctools/ccc....all-in-one-bar.
    Ignore the trending stuff (remove trendType). Experiment with it, and then replicate it in CDE, by adding a Bar chart component.

  3. #3
    Join Date
    Feb 2011
    Posts
    840

    Default

    yeah, I did found that All-on-one bar and thought it would do the trick. My problem really is being the chart component recognizing the data source.
    Both table component and chart component are set with the same datasource. Table shows fine, but chart shows only the title, no other information seems to be loaded there...

    No errors, chart's title is being properly displayed where it should... the only problem, really, is that not even a basic chart will show up.

    Listeners, parameters, datasource and htmlobject all set.

    [edit]
    I seem to be getting the hang of it. Size was missing. I just wish there was more documentation about CDE out there, and not only on those paid tutorials. Sad thing, comparing to Kettle. Anyway, I think I'm getting the hang of it. Didn't really had to use that code from http://www.webdetails.pt/ctools/ccc....all-in-one-bar - all I had to do was set the series name on "Plot2Series" (but I did just found that out because of the previously mentioned link).

    Problem now is... I have no idea how to correctly format the dots numbers, or how to invert the date scale...

    Name:  example2.jpg
Views: 1329
Size:  32.3 KB

    In the example above, my aim is to:
    - get it to show the green dots numbers as '0.00%'
    - dates lower->higher, instead of higher->lower
    - increase value axis to 10% higher than the highest displayed value
    - set minimum value axis to 10% lower than the lowest displayed value
    - set minimum Plot2 value to 0.09%

    I'm not asking for fish here, really do wanna learn to how fish. If anyone has tips on how should I go, my eyes and ears are all yours.
    Last edited by joao.ciocca; 08-29-2013 at 05:49 PM.
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

  4. #4
    Join Date
    Mar 2012
    Posts
    645

    Default

    Quote Originally Posted by joao.ciocca View Post
    I'm not asking for fish here, really do wanna learn to how fish. If anyone has tips on how should I go, my eyes and ears are all yours
    Got it. I'll give you the fix, along with some fishing rules ;-)

    Feel free to skip the considerations and explanations and go directly to the code blocks -- the solutions.

    Quote Originally Posted by joao.ciocca View Post
    get it to show the green dots numbers as '0.00%'
    Starting with a hard one... read why:

    This use case is configured in a way that doesn't correctly reflect the underlying concepts... (it's the only way that CCC currently supports)

    From a business perspective, there are actually two measure/value dimensions: the one shown in the bars (ex: quantity, sales) and the one shown in the lines (ex: growthPct, efficiency).
    Generally, each measure:
    • has a different name
    • has a different label
    • could have a different data type
    • has a different format for its values

    The way this is being mapped, there is a single dimension, named "value". One dimension has a single name, label and format.
    Rows are divided between the main and second plot according to a row's series value.

    So, things start to break, in that a bunch of things, that come for free, are lost:

    • The default tooltip shows a business summary, listing every (non hidden) dimension; each dimension shows it's label and actual formatted value, according to the dimension's formatter.
    • The ticks' labels, of discrete cartesian axes, also use the dimension's own format (not so relevant here because we're talking about continuous dimensions, which are represented in continuous cartesian axes).
    • The value labels of dots, slices, bars, etc., also use the dimension's own format.
    • The valueFormat chart option isn't meaningful, cause it is just sugar for defining the single "value" dimension's formatter...

    If we want that the user has a 5 star experience, we then need to override the defaults of all these things...

    To change the text of the value label of plot2, you have to override the "text" property of the corresponding protovis pv.Label object. This is what extension points are for (for when there are no direct, specially handled, CCC options for something). The extension point is the text property of the extension object identified as plot2Label.

    Code:
    plot2Label_text: function() {
        return (this.scene.vars.value.value *100).toFixed(2) + "%";
    }
    If you want to have a custom tooltip, to be able to control the "value" dimension's label and value format, see examples here and here. Use the value of the "series" variable to detect the current use of the "value" dimension.

    Quote Originally Posted by joao.ciocca View Post
    dates lower->higher, instead of higher->lower
    There are two inside-CCC ways to do this.

    By default, discrete dimensions are ordered by their natural order -- the order in which values are read...
    A dimension's order can be changed, though, by specifying its comparer. But this means giving up of its natural order, which might not be desired -- only want to reverse the natural order, right?

    So the dimension's natural order is kept, and the dimension's usages are changed instead -- visual roles are bound to/consume dimensions. A visual role's general order can be reversed by specifying its isReversed property:
    Code:
    categoryRole: {isReversed: true}
    Note 1: setting the options of the category visual role this way doesn't change its bound dimension(s), that, by default, in this case, is the single "category" dimension.

    Note 2: this option must be set in code, for example in the "postFetch" handler (read how and why).

    Quote Originally Posted by joao.ciocca View Post
    -increase value axis to 10% higher than the highest displayed value
    -set minimum value axis to 10% lower than the lowest displayed value
    Highest and lowest displayed value
    Do you mean that the bars' 0 value should not be shown?
    That the scale should start at the minimum existing value, possibly 10% before?
    You wanna focus on differences between bars' values, instead of on their absolute values?

    If so, setting the option orthoAxisOriginIsZero to false stops forcing the scale to contain the 0 value.
    Unfortunately, non-stacked bar charts currently have a bug in that, even with orthoAxisOriginIsZero set to false, the bars keep being drawn from 0, which often is located off-screen... This will be fixed asap, though

    10% before and after, displayed values
    It's ugly that the bars with the highest value touch the top border...and so, margins are needed.
    But, there's no way to do exactly what you want.

    The option orthoAxisOffset configures the begin and end margins of an axis, both to be 10% of the total available length (px). The remaining available space is mapped to the actual domain of the scale, that depends on many other options, like orthoAxisOriginIsZero, domainRoundMode, orthoAxisFixedMin, orthoAxisFixedMax, etc...
    Under certain circumstances, this method is equivalent to increasing 10% of the domain's extent on each end.
    There's a major difference though. The axis doesn't show extra ticks, or a bigger rule, to fill this additional space. That could be interpreted by the user as there really existing domain points in that area.

    Nonetheless, I accept that increasing the domain ends by a given value or percentage might be useful. Mostly for aesthetics reasons?
    The domainRoundMode option does this for aesthetics, sacrificing accuracy of representation of the actual domain.
    When set to the value tick, the scale's domain is increased to coincide with the minimum and maximum tick values. Enough ticks are generated so that they include the real domain values. When orthoAxisOffset is 0, this ensures that the begin and end ticks coincide with the plot's frame.
    When set to the value nice, the scale's domain is increased so that its ends are nicely rounded numbers. The first and last ticks will generally be inside this extended domain. We'll evaluate the need for directly specifying a scale's domain margin. Until such a feature exists, your off to using a mix of orthoAxisOffset > 0 and possibly domainRoundMode = tick or nice (which often looks more like you wanted it to):

    Code:
    {
       orthoAxisOffset: 0.02,
       orthoAxisDomainRoundMode: 'tick'   
    }
    Quote Originally Posted by joao.ciocca View Post
    set minimum Plot2 value to 0.09%
    That's an easy one:
    Code:
    {
        ortho2AxisFixedMin: 0.09
    }
    Last edited by duarte.leao; 09-12-2013 at 06:54 AM. Reason: fixed value of orthoAxisOffset (was '2%')

  5. #5
    Join Date
    Feb 2011
    Posts
    840

    Default

    WOW! That was thorough! I'm gonna take some time reading, re-reading and trying to understand and apply all that material. Thanks A LOT Duarte!
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

  6. #6
    Join Date
    Feb 2011
    Posts
    840

    Default

    okay, I digested some of it and decided to go try it out... already fumbled. So far, all I did with CCC was through CDE. So I though: I'll just add those 3 lines about the 0.00% format to "Custom Chart script". But if I do that, the charts dissapear. And I notice there's a red mark on the side: "Missing function identifier".

    Maybe I should have made a proper introduction here before asking about things. I'm not really much of a text-liner coder, I'm more graphical (hence why I love Kettle, PDI). But this thing really got to me, so if I need to learn this damn lines and typing to make it work as I want, I'll do it.

    I feel like I skipped a lot here, went straigth to installing CTools on BI Server, and on using CDE... while I understood the idea of what you explained, I feel now lost as to where to correct those things.

    [edit]
    so I took more time reading through things and found this.
    In a Protovis component all you have to do is to supply the function that draw the Protovis chart. You do it by typing the function in the Custom Script. The function should be like the following:
    Code:
    function(vis,data) {
        // vis - the container where protovis objects will be drawn
        // data - result of the query, if applicable
            // your code
    }
    I understand I need to use that in the Custom Script of the "Protovis component", and a "new pvc.BarChart" like the ones from those examples on the CCC page. I just don't understand yet how to implement this - and how to link the "data" in the code above.
    Last edited by joao.ciocca; 09-02-2013 at 10:56 AM.
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

  7. #7
    Join Date
    Mar 2012
    Posts
    645

    Default

    Hi,

    I am now not sure if you are using the CCC chart components that are directly available in the CDE components palette or, not using CDE and using CCC directly with CDF or a webpage, or if you want do do everything with the CDE protovis convention.

    My guess is that you saw those CCC site's chart definition's snippets («new pvc.BarChart(...)...») and thought there was some way to just paste that in a CDE component.

    CCC
    It's a JavaScript library that can be used standalone, in a web page or even a server environment (for printing, for example, as CGG does).
    You just need to include the right scripts and CSSs and instantiate a CCC chart, by writing code as simple as the one you saw, in the CCC's web site's examples: «new pvc.BarChart(...)...».
    Inside, a CCC chart does some processing which culminates instantiating protovis marks, for rendering and interaction.

    CCC in CDE
    CDE is shipped with charting components, most of which use an underlying CCC chart. There's one CDE chart component for each of the major CCC chart types.
    The CDE components are mostly wrappers of the corresponding CCC chart class.
    They take care of:
    • converting options received from its CDE definition (collected from the Properties table) into CCC chart options
    • instantiating the underlying CCC chart instance with the calculated CCC chart options
    • implementing the CDE components' lifecycle
      • exposing a "preExecution" handler
      • fetching data to feed the chart, by using the datasource property
      • exposing a "postFetch" handler
      • (CCC chart instance is created and rendered)
      • exposing a "postExecution" handler


    ​Most options of CCC charts are available as a same named CDE component property, that is exposed in the editor's "Properties" tool window.
    Yet, some more advanced options are not exposed in CDE, mostly because they would involve developing some specific type of control to edit them, for which there was no time yet.
    Those unmapped options can still be specified using CCC chart options, directly, in code. You can do this in one of the CDE handlers "preExecution" and "postFetch", as these are called before the underlying CCC chart instance is created and rendered.

    CDE components' handler functions are called having the CDE component instance in the JavaScript «this» value, from which you can access the "chartDefinition" field:
    Code:
    function() {
        // Contains options that were specified in 
        // the CDE properties tool window, already translated.
        var cccOptions = this.chartDefinition;
        
        // Add/override CCC options
        cccOptions.dimensions = { ... };
        ...
        
       // Beware that extension points require special treatment
       // (these are not yet translated to CCC options format)
       var eps = Dashboards.propertiesArrayToObject(cccOptions.extensionPoints);
       eps.plot2Label_text = function() { ... };
    
       // Convert them to original CDE format:
       cccOptions.extensionPoints = Dashboards.objectToPropertiesArray(eps);
    
    }
    See also what is said here relating to this.

    CCC in CDF
    I will not approach this here, but you can read about it here.

    CCC in CGG
    You can print any CCC chart with CGG, but if you have a CDE/CCC chart component, this is possible out of the box. Press SHIFT+G while in the CDE editor, check the names of the chart(s) you want to print, copy the corresponding url(s), save the dashboard and paste the url(s) in a browser window.

    Protovis in CDE
    If CCC charts don't satisfy your specific visualization scenario, you can always write your own visualization directly in protovis "code". CDE comes with a "Protovis" component that allows you to do just that... That's where you'll use the "Custom Script" property you mentioned. But be aware that this is not an adequate component for creating a CCC chart instances, like you mentioned. For that you have the CDE's CCC chart components.
    Last edited by duarte.leao; 04-10-2014 at 02:12 PM. Reason: Added how to specify extension points in code; Fixed link for CCC in CDF

  8. #8
    Join Date
    Feb 2011
    Posts
    840

    Default

    Thanks for another lesson, Duarte! If you happen to come to Brasília anytime, give me a shout =) a round of beer (or caipirinha, or juice =p) is on me for these! =)

    Okay, now I can identify that I'm using the CCC Bar Chart component inside CDE. Guess that's why I got totally lost with the textual programming while almost everything I was being able to do was through CDE (I guess the only textual thing I needed to meddle so far was gradient colors, like "linear-gradient(90deg, darkorange, peachpuff, darkorange)").

    Work in progress is going well. I can say that I manage the basics now. But those main difficulties remain...
    Name:  2013-09-03_14h22_01.jpg
Views: 1547
Size:  27.9 KB

    I still fail to understand how to apply the formatting you explained before. I understood where (postFecth or preExecution), but still fail to grasp the how.
    Code:
    plot2Label_text: function() {
        return (this.scene.vars.value.value *100).toFixed(2) + "%";
    }
    Searching the forums, I found this, and thought that would be the way to apply it... hence,
    Code:
    function f(data) {    var cccOptions = this.chartDefinition;
    
    
       // For changing extension points, a little more work is required:
       var eps = Dashboards.propertiesArrayToObject(cccOptions.extensionPoints);
    
    
       // add extension points:
        eps.plot2Label_text = function() {
            return (this.scene.vars.value.value *100).toFixed(2) + "%";
        };
       
        return data;
    }
    but... nothing happened.

    On that SHIFT+G/CGG tip, saving after enabling CGG will give me the following error on log and prevent me from preview/save on CDE:
    Code:
    Caused by: org.apache.commons.jxpath.JXPathException: No value for xpath: properties/.[name='parameters']/value
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

  9. #9
    Join Date
    Mar 2012
    Posts
    645

    Default

    Sorry, about the extension points... I tried not to complicate things too much, and omitted the special case. I've updated the previous post with the code that you have to write to add extension points in code.

    About the error when saving/previewing the dashboard after activating chart printing, that's odd. It can be an existing bug or a solved one... What CDE version do you have installed?

  10. #10
    Join Date
    Feb 2011
    Posts
    840

    Default

    thanks once again Duarte! I'll try with these new instructions! [edit]awesome! it works =) thanks a LOT![/edit]

    CDE's About says I've installed v13.06.05 - just downloaded and ran the ctools-installer.sh through cygwin. But my internet connection here is kinda limited, so the same CDE's About says that it could not parse remote file to check for newer versions.

    [edit]okay, going over from the top...
    1- format numbers to show with 0.00% formatting - ok! =)

    2- dates lower->higher, instead of higher->lower - following given examples, and the formatting that worked, I tried this:
    Code:
        // Add/override CCC options
        cccOptions.dimensions = {
            categoryRole: {isReversed: true}
        };
    It doesn't seem to do anything. I read through given links like http://www.webdetails.pt/ctools/char...tml#dimensions over and over, but I can't seem to find what I'm doing wrong... I'll blame that on my lack of Js knowledge and keep looking to overcome it.

    [edit2] so, I found once again slawo's post about CDE and remembered that I CAN do this right on the CDA with SQL. I always forget that a sub-query can be re-arranged using an alias table (I always forget that damn "as anything" after the parenthesis, and so whenever I try to do that it fails and sends me to a google search on how to make it work).[/edit2]

    3-10% before and after, displayed values - orthoAxisOffset doesn't seem to do anything withing CDE's advanced options. But I did notice, after formatting percentage numbers, that some of it was being drawn out of plotting area, and so weren't appearing. contentMargins did the trick for this part, but I still can't seem to make the highest bar not touch the top of chart.

    Also, orthoAxisOffset won't accept '2%', not even 2% - CDE displays an error message saying that the property needs to be numeric.
    Last edited by joao.ciocca; 09-04-2013 at 12:16 PM.
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

  11. #11
    Join Date
    Mar 2012
    Posts
    645

    Default

    Hi,

    2- "categoryRole" is a direct chart option, not a property of "dimensions". So you should do:
    Code:
    cccOptions.categoryRole = {isReversed: true};
    3- My mistake. I've edited the initial post.

    The option "orthoAxisOffset" does not support percentage strings, as most size related options do - this is for compatibility with CCC v1. You have to specify a number between 0 and 1, like 0.02.
    Note also, that this option only takes effect on the axis' ends that are not fixed by some other reason, like FixedMin/Max and OriginIsZero.
    If you also use a DomainRoundMode of 'nice' or 'tick', the tick rounding may result in a higher axis offset than the one requested, and it might seem not to be working. Specify a 10% offset to see it taking effect, over the tick rounding margin.

  12. #12
    Join Date
    Feb 2011
    Posts
    840

    Default

    hm... I'll keep this whole thread bookmarked for future reference =)

    In the end we ditched the idea of variable minimal values, so I'll leave the orthoAxisOffset tests to some future time.

    Thanks a lot Duarte! This was the end result of my first attempt at CDE/CCC =) Couldn't have done it without all this help you gave me!

    Name:  2013-09-12_09h49_13.jpg
Views: 958
Size:  22.8 KB

    I decided to shrink it so I wouldn't need to worry about them numbers =p but I have two select at the top, one for doc type and the second for date (year/month), which interact with two parameters. Date parameter listens to doc type changes, since there are 2 doc types, and sometimes there is a "doctype A" for, example, Dec/2014, but there's still no "doctype B" for the same date; and so date gets updated when doctype changes.

    All the 8 charts (4 bar charts, 4 bullet charts) listen to changes on doctype and date, and update acordingly. Bullet charts datasource is a KTR transformation, while bar charts are fed from an SQL datasource.

    And all this in two weeks, from not even knowing where to start to the final product! All that's left now is the boss' approval of color scheme - or adaptations on it.

    By the way, there's still two little doubts left on this implementation:
    1- can the bullet chart be fed variable ranges - or at least a variable max range? If so, how can I accomplish this?

    2- can the bullet chart be "turned around"? That last bullet chart would look better if I could make it start from right to left, to fit the green-yellow-red color scheme of the group...
    Last edited by joao.ciocca; 09-12-2013 at 08:59 AM.
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

  13. #13
    Join Date
    Mar 2012
    Posts
    645

    Default

    Olá João,

    1) The range of the drawn axis stretches to the existing data. Yet, the last colored range region, in the background, does not stretch accordingly. As a workaround, you might want to adjust the last range's value according to the received value (the bar) and marker (the bullet).

    2) Use the extension point: «bulletPanel_orient: "right"»!

  14. #14
    Join Date
    Feb 2011
    Posts
    840

    Default

    Duarte, you still around?

    I think I still need some lessons on the programming part... I thought this should work:
    Code:
    function() {    
        // Contains options that were specified in 
        // the CDE properties tool window, already translated.
        var cccOptions = this.chartDefinition;
        
       // Beware that extension points require special treatment
       // (these are not yet translated to CCC options format)
       var eps = Dashboards.propertiesArrayToObject(cccOptions.extensionPoints);
       eps.plot2Label_text = function() {
           return (this.scene.vars.value.value).toFixed(2) + "%";
       };
       eps.xAxis_Label = function() {
           var data = this.scene.vars.value.value;
           return data.substr(0,3) + "/" + data.substr(4,5);
       }
       // Convert them to original CDE format:
       cccOptions.extensionPoints = Dashboards.objectToPropertiesArray(eps);
       cccOptions.categoryRole = {isReversed: true}; 
     }
    adding only that "formatting" part for x axis in the code you previously gave me for formatting a number that had no '%' symbol... but it doesn't work.
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

  15. #15
    Join Date
    Mar 2012
    Posts
    645

    Default

    Hi João,

    the extension point is "baseAxisLabel_text". But wait! If you do it that way, the axis auto-sizing feature will not work and still reserve space for the initial text...
    Can you change the format of the category dimension, including when it shows up in the legend? If so, specify the dimension's formatter:

    Code:
    function() {
        this.chartDefinition.dimensions = {
           category: {
                formatter: function(v) {
                    return !v ? "" : (v.substr(0,3) + "/" + v.substr(4,5));
                }
           } 
       };
    }

  16. #16
    Join Date
    Feb 2011
    Posts
    840

    Default

    yeah... the day after I posted this I thought about "why don't I treat this in the transformation that feeds the data?" - so I used a simple Number Range and some other minor things, didn't perceived any impact on performance, since it's little data, and that way I could even change from "yyyyMM" to "mmm/YY" =) but thanks, I'll remember about that one =)
    Join us on IRC! =)

    Twitter / Google+ / Timezone: BRT-BRST
    BI Server & PDI 5.4 / MS SQL 2012 / Learning CDE & CTools
    Windows 8 64-bit / Java 7 (jdk1.8.0_75)

    Quote Originally Posted by gutlez
    PLEASE NOTE: No forum member is going to do your work for you. We will help you sort out how to do a specific part of the work, as best we can, in the timelines that our work will allow us.

    I'm no expert.Take my comments at your own risk.

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.