Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

How to set the Legend color of choice for a specific data type.

$
0
0
****How to set Legend color of choice for a specific Legends type.***


1. Smart GWT version:-
v9.0p_2013-08-25/PowerEdition Deployment (built 2013-08-25)

2. Problem statement:
I want the color of city Type-"Country" to be Red, "Town" as Green and "Urban" as Blue and so on. I can have several records having one of these types as either Country or Town or Urban.

In the attached sample code only two legends are there Town(Red) and Country(Green). The COLORS array contains {Red,Green}. The red color ties up with the legend type (Country or Town) whichever comes first in the Bar data records. The legend color ties up with the "type" as and when the city Type comes in the Bar data records.
If the first record contains type as "Country" then the Red color legend is for "Country" type and if the first record contains type as "Town" then the Red color legend is for "Town" type .

How can I set the specific Legend color for a specific city Type irrespective of the order in which the city Type is present in the Bar Data records?

Attached Images
File Type: png Specific Legend color code issue.png (54.3 KB)
Attached Files
File Type: xml ChartDemo.gwt.xml (1.3 KB)
File Type: html ChartDemo.html (659 Bytes)
File Type: java ChartDemo.java (14.9 KB)
File Type: java DynamicBarChart.java (3.5 KB)

Viewing all articles
Browse latest Browse all 4756

Trending Articles