Forum Stats

  • 3,782,456 Users
  • 2,254,650 Discussions
  • 7,880,082 Comments

Discussions

How to customize ojet Chart Enlarge Legend Symbols

User_RPM7N
User_RPM7N Member Posts: 7 Green Ribbon
edited Mar 11, 2021 7:57AM in APEX Discussions

Hello,

in our chart we use symbolType: "image";

The size-paramter has no effect?

function( options ) {

   

    options.dataFilter = function( data ) {

     data.legend = {

           sections:[{ items:[] }]

       }

       

        for ( var i = 0; i < data.series.length; i++ ) {

              data.legend.sections[ 0 ].items.push( {

               text: data.series[ i ].name,

               color: data.series[ i ].color,

               symbolType: "image",

              symbolSize:50,

               symbolWidth:50,

               symbolHeight:50,

               source: gAppImages + "legend/" + data.series[ i ].name + ".png"

           });

            data.series[ i ].displayInLegend = 'off';

       } 

        return data;

   }

   return options;

}


Is there a way to enlarge the symbols.. they are soooo small😥


============================

MANY THANKS 😊 and greetings from Munich

 

Best Answer

  • Oleh Tyshchenko
    Oleh Tyshchenko Member Posts: 714 Gold Trophy
    Accepted Answer

    But symbolWidth and symbolHeight must be defined at legend level not legend item. So your code should looks something like this:

    function( options ) {
      
      options.dataFilter = function( data ) {
       data.legend = {
          sections:[{ items:[] }],
          symbolWidth:50,
          symbolHeight:50
        }
        
        for ( var i = 0; i < data.series.length; i++ ) {
           data.legend.sections[ 0 ].items.push( {
            text: data.series[ i ].name,
            color: data.series[ i ].color,
            symbolType: "image",
            source: gAppImages + "legend/" + data.series[ i ].name + ".png"
          });
          data.series[ i ].displayInLegend = 'off';
        } 
        return data;
      }
    
      return options;
    }
    

Answers

  • Oleh Tyshchenko
    Oleh Tyshchenko Member Posts: 714 Gold Trophy

    The size-paramter has no effect?

    If you are talking about symbolSize attribute than there is no such thing in JET legend

    symbolWidth and symbolHeight should work


  • Oleh Tyshchenko
    Oleh Tyshchenko Member Posts: 714 Gold Trophy
    Accepted Answer

    But symbolWidth and symbolHeight must be defined at legend level not legend item. So your code should looks something like this:

    function( options ) {
      
      options.dataFilter = function( data ) {
       data.legend = {
          sections:[{ items:[] }],
          symbolWidth:50,
          symbolHeight:50
        }
        
        for ( var i = 0; i < data.series.length; i++ ) {
           data.legend.sections[ 0 ].items.push( {
            text: data.series[ i ].name,
            color: data.series[ i ].color,
            symbolType: "image",
            source: gAppImages + "legend/" + data.series[ i ].name + ".png"
          });
          data.series[ i ].displayInLegend = 'off';
        } 
        return data;
      }
    
      return options;
    }
    
  • User_ER0DI
    User_ER0DI Member Posts: 1 Blue Ribbon

    ⭐️⭐️⭐️1000 Thanks , it works so fine⭐️⭐️⭐️

    greetings from Munich😀

  • User_RPM7N
    User_RPM7N Member Posts: 7 Green Ribbon

    ⭐️⭐️⭐️1000 Thanks , it works so fine⭐️⭐️⭐️

    greetings from Munich

    😀