Hitachi Vantara Pentaho Community Forums
Results 1 to 10 of 10

Thread: NewMapComponent with circle marker

  1. #1

    Lightbulb NewMapComponent with circle marker

    Hello community,

    Recently, I am developing dashboard in which i want to display map with circle marker.And also circle radius is depends on data.

    Please help me to solve this issue.

    Thanks & Regards
    Gaurav Ashara

  2. #2
    Join Date
    Nov 2011
    Posts
    1,229

    Default

    Take a look at the samples provided with CDE. I think they'll prove helpful.
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  3. #3

    Exclamation Plugin sample & My sample attachement

    @PamVal :Thanks for reply.

    Actually i go through sample but it didn't work on my pentaho. Find attached contains pentaho sample plugin example and my sample dashboard with its CCC chart's JS.

    When i run my sample dashboard i got this error log.

    12:24:24,513 ERROR [BaseScript] org.mozilla.javascript.EvaluatorException: illegal character (MapChart.js#1)
    12:24:24,515 ERROR [CggService] java.lang.NullPointerException


    Thanks & Regards
    Gaurav Ashara

    Keep Coding
    Attached Files Attached Files

  4. #4
    Join Date
    Nov 2011
    Posts
    1,229

    Default

    What Pentaho and ctools versions are you using ?
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  5. #5

    Default

    Thanks for reply. Ok.

    I am using Pentaho 5.0.1 CE and CTools version

    Community Dashboards Framework :- TRUNK-SNAPSHOT
    Community Data Access :-TRUNK-SNAPSHOT
    Community Dashboard Editor TRUNK-SNAPSHOT
    Community Graphics Generator :- 5.0.1-stable (TRUNK)



    Thanks & Regards
    Gaurav Ashara
    Last edited by gaurav.ashara; 12-01-2014 at 06:19 AM.

  6. #6
    Join Date
    Nov 2011
    Posts
    1,229

    Default

    Your ctools versions should match - my suggestion is to update them all to the latest stable release, 14.10.15.
    Pedro Vale
    --
    CTools Product Development
    http://www.webdetails.pt

  7. #7

    Default

    Aha ... Its done

    Thank Your Very much.

    Thanks & Regards
    Gaurav Ashara

  8. #8
    Join Date
    Jun 2014
    Posts
    13

    Default

    Quote Originally Posted by gaurav.ashara View Post
    Hello community,

    ... i want to display map with circle marker.And also circle radius is depends on data.
    Hello,

    how is it possible to change circle radius (marker width/height) dynamically (depended on data)?
    Or change a color of pie depending on data in Description - How to obtain pie chart data from context and in which method to change the chartDefinition.colors (Post Fetch?)?

    Thank you,
    Martin
    Last edited by mzahrada; 01-06-2015 at 05:06 AM.

  9. #9

    Default

    Hello ,

    You can refer this sample example of Pentaho

    location :: /public/plugin-samples/pentaho-cdf-dd/tests/FullMapTest.wcdf

    http://localhost:8080/pentaho/api/re...neratedContent

    In above location you can find file called salesGraphForMarker.js . Actually CCG chart defination come from here.In that chart defination you can specify your data source (contains radious).


    Make sure that you have Community tool version 14.10.15 otherwise it didn't work.

    Thanks & Regards
    Garuav Ashara

  10. #10
    Join Date
    Feb 2017
    Posts
    1

    Default

    in the map compoenent you can change the fill color , the radius of the markers , and you can even make radius and color change between each marker in the map component !!!!! it is a powerful component !! here is how to make all markers have same customized radius and color :
    in the pre execution method put:

    this.styleMap={};
    $.extend(true,this.styleMap,{markers:{r:10}});
    $.extend(true,this.styleMap,{markers:{fill:"rgba(0,0,250,1)"}});

    this modification will make the markers have radius of 10, and fill of blue since rgba(0,0,250,1) means blue more about rgba color syntax
    if you want your markers change the radius and color depending on each row you should have in tha data returened by your datasource have column called "r" wich contains radius for the marker for that entry, you can create that column in the postFetch and populate it as you like depending on informations on that row , or you can make it as calculated column in the dataaccess view of cde , or what ever your imagination tells you , it just has to be there when the map component is rendering the data , one important thing is that the radius column should have type 'Numeric' not Integer or String or something else otherwise it will not work!! i say that because if you use scriptable cda dataaccess(beanshell or json) the column which contains number is of type Integer and not Numeric which might drive you crazy for a little while and start inspecting the map component source code and other pains !!!!!
    you can change the type in the metadata property data object passed to postfetch !!! like this
    //let's suppose that the fourth column is the radius column

    function(data){
    data.metadata[3].colType="Numeric";
    return data;
    }


    to change the color same applies you should have column named fill of type Numeric and contains a number between 0 and the length of color map array (you can populate colormap in the component advanced properties i used rgba syntax like "rgba(0,250,0,1)" for green) if we use an array like this
    ["rgba(255,0,0,1)","rgba(0,255,0,1)","rgba(0,0,255,1)"]
    and our data was like
    ['al-Quds','Palestine',2] //our columns are like this ['City','Country','fill']
    than the marker over al-Quds would be blue because color of index 2 in the color map in "rgba(0,0,255,1)" which is blue !!!!
    hope that helped !!!!
    Last edited by suomynona; 02-13-2017 at 11:11 AM.

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.