Redrawing ejchart

During a process I hit a button that redraws an ejChart with chartObj.model.legend.visible = "true". This works but for some reason the legend only has 2 items instead of 4 (pictured below). Along with this, when I try to set visible to false after the function runs, the legend does not disappear. I call redraw but it doesn't seem to work. Any idea?

3 Replies

DD Dharanidharan Dharmasivam Syncfusion Team August 28, 2018 09:59 AM UTC

Hi Caleb, 

We have analzed your query. You have specified that you have attached screenshots, unfortuantely there were no attachments in the ticket. However we suspect that while exporting the chart, you toggle the legend’s visibility. In any case, if you want the toggle the legend visibility, you have to specify the boolean property without single/double quotes, so that it will work properly. We have prepared a sample in which while exporting the chart to image, we have hidden the legend with the below. 

JS: 

function Export(anchor) { 
           var chartObj = $("#container").ejChart("instance"); 
            //Hidden the legend before exporting 
            chartObj.model.legend.visible = false; 
            chartObj.redraw(); 
 
            //Configurations for exporting 
 
            //Displayed the legend after exporting as image 
           chartObj.model.legend.visible = true; 
            chartObj.redraw(); 
        } 


Sample for reference can be find from below link. 
 
If you have still any concerns with the legend, kindly provide us more information on which scenario you need to toggle the legend visibility and attach the screenshots. If possible kindly try to reproduce your scenario with the attached sample or provide your sample with replication steps, this will help us to provide you the solution at earlier. 

Thanks, 
Dharani. 



CK Caleb Kliewer August 28, 2018 02:59 PM UTC

Hiding the chart seems to be working now. I believe the issue was that I was using quotes (ex: "false" instead of false). I'm still have problems with only half the legend showing. I set the height to 150px and width to 130px but it still does not show. It is pictured below. It should have 4 legend items instead of 2.



DD Dharanidharan Dharmasivam Syncfusion Team August 29, 2018 08:41 AM UTC

Hi Caleb, 

We have tried to replicate the reported scenario at our end. We are afraid that we can’t reproduce the scenario and the legends are showing properly at our end. Sample used for testing can be find from below link. 


In the above sample we have specified height and width as 150 and 130 respectively for legend. Also we have specified size for chart as 300*300 (height and width). The legends are properly visible at our end. Kindly find the screenshot below. 

 

Since we are unware of the exact scenario on which the half of the legends were not visible, kindly try to reproduce the reported issue with the attached sample or provide your sample with replication steps else share the code snippet with the data source and with your current Essential Studio version, this will be helpful in providing the solution at earlier. 

Thanks, 
Dharani. 




Loader.
Up arrow icon