Hi Mario,
Use a <chartstyle> to style charts. I copied the default one from
lps/components/charts/styles/defaultchartstyle.lzx into my source file
and modified it. Here is an example. I'm using 3.1.1 which has a few bug
fixes for the charting components.
Regards,
Garth
<canvas>
<font name="chartfont" src="bitstream-vera-1.10/vera.ttf" />
<dataset name="testDataSet">
<measurementlist>
<measurement value="6.0" time="24" info="Dec/05 (6.0)"/>
<measurement value="5.1" time="12" info="May/05 (5.1)"/>
<measurement value="2.0" time="0" info="Dec/04 (2.0)"/>
</measurementlist>
</dataset>
<chartstyle name="testChartStyle">
<plotstyle name="plot" linesize="0" />
<chartbgstyle name="chartbgstyle">
<linestyle name="line" size="0" color="0xF9F9F9" />
<regionstyle name="region" color="0xF9F9F9" />
</chartbgstyle>
<axisstyle name="haxisstyle">
<labelstyle name="label" font="chartfont" fontsize="10" />
<tickstyle name="tickmajor" color="0x000000"
position="outside" length="4" size="1">
<labelstyle name="label" font="chartfont" fontsize="9"
fontcolor="0x000000" linesize="0" />
</tickstyle>
<linestyle name="axisline" color="0x000000" size="1" />
<linestyle name="gridline" type="dashed" color="0x000000"
size="1" opacity=".2" />
</axisstyle>
<axisstyle name="vaxisstyle">
<labelstyle name="label" font="chartfont" fontsize="10"
fontangle="270" />
<tickstyle name="tickmajor" color="0x000000"
position="outside" length="4" size="1">
<labelstyle name="label" font="chartfont" fontsize="9"
fontcolor="0x000000" linesize="0" />
</tickstyle>
<linestyle name="axisline" color="0x000000" size="1" />
<linestyle type="dotted" name="gridline" color="0x000000"
size="1" opacity=".5" />
</axisstyle>
<valuepointstyle name="valuepointstyle">
<pointstyle name="point" width="3" height="12"
color="0x73b769" />
<labelstyle name="label" font="chartfont" fontsize="7"
fontcolor="0x000000" linecolor="0x000000" fillcolor="0xFFFFC1"
linesize="2" />
<labelstyle name="tip" font="chartfont" fontsize="12"
linecolor="0xCCA213" linesize="2" fillcolor="0xFFCB18" />
</valuepointstyle>
<valuelinestyle name="valuelinestyle">
<linestyle name="line" color="0x000000" size="2" opacity="1" />
<labelstyle name="label" font="chartfont" fontsize="10"
fontcolor="0x000000" linecolor="0x000000" fillcolor="0xFFFFC1"
linesize="2" />
<labelstyle name="tip" font="chartfont" fontsize="10"
fontcolor="0x000000" linecolor="0x000000" fillcolor="0xFFFFC1"
linesize="2" />
</valuelinestyle>
<valueregionstyle name="valueregionstyle">
<linestyle name="line" color="0x00ff00" size="1" opacity=".5" />
<regionstyle name="region" color="0x00ff00" opacity=".1" />
<labelstyle name="label" font="chartfont" fontsize="12"
fontcolor="0x000000" />
<labelstyle name="tip" font="chartfont" fontsize="12"
fontcolor="0x000000" />
</valueregionstyle>
<datastylelist name="datastyles">
<datastyle name="datastyle1">
<pointstyle name="point" width="7" height="7"
color="0x28A3C2" shape="triangle" />
<linestyle name="line" color="0x28A3C2" size="0"
opacity=".8" />
<regionstyle name="region" color="0x28A3C2" />
<labelstyle name="label" font="chartfont" fontsize="9"
fontcolor="0x0000FF" />
<labelstyle name="tip" font="chartfont" fontsize="12"
linecolor="0xCCA213" linesize="2" fillcolor="0xFFCB18" />
</datastyle>
<datastyle name="datastyle2">
<pointstyle name="point" width="7" height="7"
color="0xed5a79" shape="square" />
<linestyle name="line" color="0xed5a79" size="1"
opacity=".8" />
<regionstyle name="region" color="0xFFFFFF" />
<labelstyle name="label" font="chartfont" fontsize="9"
fontcolor="0x0000FF" />
<labelstyle name="tip" font="chartfont" fontsize="12"
linecolor="0xCCA213" linesize="2" fillcolor="0xFFCB18" />
</datastyle>
</datastylelist>
</chartstyle>
<linechart name="testChart" width="270" height="150"
style="testChartStyle"
datatipEnabled="true" datatipColumn="datatip"
dataPointsEnabled="true"
verticalGridLines="false" horizontalGridLines="true"
datalabelEnabled="false" datalabelColumn="datalabels"
valueregionsenabled="true">
<valueregion data1="0" data2="7" axis="y" />
<dataseries datapath="testDataSet:/measurementlist">
<datacolumn name="x" columndatapath="measurement/@time"
datatype="number" />
<dataseries label="value">
<datacolumn name="datatip"
columndatapath="measurement/@info" datatype="string" />
<datacolumn name="y" columndatapath="measurement/@value"
datatype="number" />
</dataseries>
</dataseries>
<horizontalaxis title="Months" type="linear" interval="3"
columnName="x" majorTickEnabled="true" minimum="0" maximum="24"
titleLocation="low" />
<verticalaxis title="Measurement" type="linear" interval="5"
columnName="y" majorTickEnabled="true" minimum="0" maximum="20"
titleLocation="low" />
</linechart>
</canvas>
Mario Jakobs wrote:
hello all,
i just start using the linechart, everthing works fine, but i can“t change
the style of the graphs (color, size). how can i do this?
Thanks
mario
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user
_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user