Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Multiple Charts from One Data Source in CDE

  1. #1

    Default Multiple Charts from One Data Source in CDE

    Can I create multiple charts with different fields from one data source in CDE?

    For example, I have one data source as below. I want to create one bar chart for date * revenue, another bar chart for date * payment. Thanks.
    +--------+------------+----------+
    | date | revenue | payment |
    +--------+------------+----------+
    | 201303 | 4.1400 | 122.4900 |
    | 201304 | 100.3900 | 9.5400 |
    | 201305 | 108.4100 | 429.1200 |
    | 201306 | 103.4400 | 119.4000 |
    | 201307 | 114.4300 | 351.1100 |
    | 201308 | 114.4300 | 155.5200 |
    | 201309 | 114.4300 | 168.5300 |
    | 201310 | 1793.1600 | 201.0200 |
    | 201311 | 1489.3000 | 216.3500 |
    +--------+------------+----------+

  2. #2
    Join Date
    Mar 2012
    Posts
    645

    Default

    Hi,

    that's possible yes. You can change the data before giving it to the cde charts, by writing code in the charts' "postFetch" handler proeprty.
    Another way is to configure each of the charts to show one or the other measure. You might even want to show both measures, in both charts, in the tooltip.

    In "postFetch" handler:
    Code:
    function () {
        // In both charts:
        this.chartDefinition.dimensions = {
            revenue:  {valueType: Number},
            payment: {valueType: Number}
        };
        this.chartDefinition.readers = ['category, revenue, payment'];
        
        // In chart showing "revenue"
        this.chartDefinition.valueRole = "revenue";
    
        // In chart showing "payment"
        this.chartDefinition.valueRole = "payment";
    }
    If you want to hide the other dimension in the tooltip, additionally specify the "isHidden" property when defining the dimension: « revenue: {valueType: Number, isHidden: true} ».

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.