How to customize the scale of the graph in chart extension? rescale

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to customize the scale of the graph in chart extension? rescale

KhunSanAung
Hi List,

I'd like to show daily water level by bar chart. Danger level has fixed value (red color), daily water levels are changing (in blue color).
I'm using the chart extension for visualization of attribute data (dangrlevellast_3_day, last_2_daylast_1_daytodayLevel).
The SLD rules that use the attribute data without any change and the results are as below screenshots. 

<ExternalGraphic>
  <OnlineResource
     xlink:href="<a href="http://chart?chxt=x,y&amp;amp;chxl=0:|Danger|3|2|1|now|&amp;amp;cht=bvg&amp;amp;chco=ff0000,0000ff,0000ff,0000ff,0000ff&amp;amp;chf=bg,s,FFFFFF00&amp;amp;chd=t:${dangrlevel}|${last_3_day}|${last_2_day}|${last_1_day}|${todayLevel}&amp;amp;chs=120x150&amp;amp;chtt=Water">http://chart?chxt=x,y&amp;chxl=0:|Danger|3|2|1|now|&amp;cht=bvg&amp;chco=ff0000,0000ff,0000ff,0000ff,0000ff&amp;chf=bg,s,FFFFFF00&amp;chd=t:${dangrlevel}|${last_3_day}|${last_2_day}|${last_1_day}|${todayLevel}&amp;chs=120x150&amp;chtt=Water Level" />
  <Format>application/chart</Format>
</ExternalGraphic>
Inline image 2
The X-axis is okay, but the resultant bar chart range from 0 to 100 only in the Y-axis. I'm not sure whether it is a percentage or not.
But the value in the attribute data are range more than 100. which is not appearing well in the graph.
So I've modified the SLD as followed to get the comparison between danger level and daily water level. 
 <ExternalGraphic>
    <OnlineResource
       xlink:href="<a href="http://chart?chxt=x,y&amp;amp;chxl=0:|Danger|3|2|1|now|&amp;amp;cht=bvg&amp;amp;chco=ff0000,0000ff,0000ff,0000ff,0000ff&amp;amp;chf=bg,s,FFFFFF00&amp;amp;chd=t:${dangrlevel/dangrlevel+50}|${last_3_day-dangrlevel+50}|${last_2_day-dangrlevel+50}|${last_1_day-dangrlevel+50}|${todayLevel-dangrlevel+50}&amp;amp;chs=120x150&amp;amp;chtt=Water">http://chart?chxt=x,y&amp;chxl=0:|Danger|3|2|1|now|&amp;cht=bvg&amp;chco=ff0000,0000ff,0000ff,0000ff,0000ff&amp;chf=bg,s,FFFFFF00&amp;chd=t:${dangrlevel/dangrlevel+50}|${last_3_day-dangrlevel+50}|${last_2_day-dangrlevel+50}|${last_1_day-dangrlevel+50}|${todayLevel-dangrlevel+50}&amp;chs=120x150&amp;chtt=Water Level" />
    <Format>application/chart</Format>
 </ExternalGraphic>
The result bar chart is as below.
Inline image 1
I've got the barchart value that I wanted to show. but the default scale for Y axis is from 0 to 100. which is not the scale I wanted.
I wanted to show the actual range in the Y-axis , danger level 700 cm, so the chart should range from 650 to 750 cm.
My question is, " How can I change the range of the Y-axis to a certain column?

Thank you very much in advanced for any help.
Best regards


--
Have a nice day!
--

Mr. Khun San Aung


------------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

attachment2 (14K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to customize the scale of the graph in chart extension? rescale

Jonathan Moules-2
Hi,
Maybe this is what you want:

Cheers,
Jonathan



On 11 August 2014 04:38, KhunSanAung <[hidden email]> wrote:
Hi List,

I'd like to show daily water level by bar chart. Danger level has fixed value (red color), daily water levels are changing (in blue color).
I'm using the chart extension for visualization of attribute data (dangrlevellast_3_day, last_2_daylast_1_daytodayLevel).
The SLD rules that use the attribute data without any change and the results are as below screenshots. 

Inline image 2
The X-axis is okay, but the resultant bar chart range from 0 to 100 only in the Y-axis. I'm not sure whether it is a percentage or not.
But the value in the attribute data are range more than 100. which is not appearing well in the graph.
So I've modified the SLD as followed to get the comparison between danger level and daily water level. 
The result bar chart is as below.
Inline image 1
I've got the barchart value that I wanted to show. but the default scale for Y axis is from 0 to 100. which is not the scale I wanted.
I wanted to show the actual range in the Y-axis , danger level 700 cm, so the chart should range from 650 to 750 cm.
My question is, " How can I change the range of the Y-axis to a certain column?

Thank you very much in advanced for any help.
Best regards


--
Have a nice day!
--

Mr. Khun San Aung


------------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users



This transmission is intended for the named addressee(s) only and may contain confidential, sensitive or personal information and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.
------------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users
Reply | Threaded
Open this post in threaded view
|

Re: How to customize the scale of the graph in chart extension? rescale

KhunSanAung
Thanks,
In the mean time, I was also exploring and finally I've got it to insert variable in the numbers using ${Field_name} .
The code is shared below, in case if someone would like to do similar things using chart extension.

---
<ExternalGraphic>
  <OnlineResource
    xlink:href="<a href="http://chart?chxt=x,y,r&amp;amp;chxl=2:|Below|Danger">http://chart?chxt=x,y,r&amp;chxl=2:|Below|Danger Level|Above|1:|${dangrlevel-50}|${dangrlevel}|${dangrlevel+50}|0:|Danger|3|2|1|0&amp;cht=bvg&amp;chco=ff3333,3333ff,3333ff,3333ff,3333ff&amp;chf=bg,s,FFFFFF00&amp;chd=t:${dangrlevel/dangrlevel+50}|${last_3_day-dangrlevel+50}|${last_2_day-dangrlevel+50}|${last_1_day-dangrlevel+50}|${todayLevel-dangrlevel+50}&amp;chtt=Water Level (cm)&amp;chs=250x150&amp;"/>
  <Format>application/chart</Format>
</ExternalGraphic>
---
the result is as below.

Inline image 1

Many thanks for your idea & support
Best regards
Mr. Khun San Aung



On Mon, Aug 11, 2014 at 4:43 PM, Jonathan Moules <[hidden email]> wrote:
Hi,
Maybe this is what you want:

Cheers,
Jonathan



On 11 August 2014 04:38, KhunSanAung <[hidden email]> wrote:
Hi List,

I'd like to show daily water level by bar chart. Danger level has fixed value (red color), daily water levels are changing (in blue color).
I'm using the chart extension for visualization of attribute data (dangrlevellast_3_day, last_2_daylast_1_daytodayLevel).
The SLD rules that use the attribute data without any change and the results are as below screenshots. 

Inline image 2
The X-axis is okay, but the resultant bar chart range from 0 to 100 only in the Y-axis. I'm not sure whether it is a percentage or not.
But the value in the attribute data are range more than 100. which is not appearing well in the graph.
So I've modified the SLD as followed to get the comparison between danger level and daily water level. 
The result bar chart is as below.
Inline image 1
I've got the barchart value that I wanted to show. but the default scale for Y axis is from 0 to 100. which is not the scale I wanted.
I wanted to show the actual range in the Y-axis , danger level 700 cm, so the chart should range from 650 to 750 cm.
My question is, " How can I change the range of the Y-axis to a certain column?

Thank you very much in advanced for any help.
Best regards


--
Have a nice day!
--

Mr. Khun San Aung


------------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users



This transmission is intended for the named addressee(s) only and may contain confidential, sensitive or personal information and should be handled accordingly. Unless you are the named addressee (or authorised to receive it for the addressee) you may not copy or use it, or disclose it to anyone else. If you have received this transmission in error please notify the sender immediately. All email traffic sent to or from us, including without limitation all GCSX traffic, may be subject to recording and/or monitoring in accordance with relevant legislation.



--
Have a nice day!
--

Mr. Khun San Aung


------------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geoserver-users