A line chart example

The specification for this chart:

<result>
	<sql>select 
		(SELECT cntr_value FROM sys.dm_os_performance_counters 
		where counter_name = 'Index Searches/sec') as "Index Scans", 
		(SELECT cntr_value FROM sys.dm_os_performance_counters 
		where counter_name = 'Probe Scans/sec') as "Probe Scans", 
		(SELECT cntr_value FROM sys.dm_os_performance_counters 
		where counter_name = 'Range Scans/sec') as "Range Scans",
		(SELECT cntr_value FROM sys.dm_os_performance_counters 
		where counter_name = 'Full Scans/sec') as "Full Scans"
	</sql>
	<result-type>GRAPHICAL</result-type>
	<graphical>
		<title>Scans</title>
		<interval>5</interval>
		<dynamic>true</dynamic>
		<resultset>
			<column>
				<name>Index Scans</name>
				<sql-type>1</sql-type>
				<diff>1</diff>
				<label/>
			</column>
			<column>
				<name>Probe Scans</name>
				<sql-type>1</sql-type>
				<diff>1</diff>
				<label/>
			</column>
			<column>
				<name>Range Scans</name>
				<sql-type>1</sql-type>
				<diff>1</diff>
				<label/>
			</column>
			<column>
				<name>Full Scans</name>
				<sql-type>1</sql-type>
				<diff>1</diff>
				<label/>
			</column>
		</resultset>
		<line-chart>
			<to-plot>Index Scans</to-plot>
			<to-plot>Probe Scans</to-plot>
			<to-plot>Range Scans</to-plot>
			<to-plot>Full Scans</to-plot>
			<chart-type>5</chart-type>
		</line-chart>
	</graphical>
</result>

You can change the colors of the chart by adding a css tag like this:

...
	</line-chart>
	<css>
		.default-color0.chart-series-line { -fx-stroke: #185AA9; }
		.default-color0.chart-line-symbol { -fx-background-color: #185AA9, white; }
		.default-color1.chart-series-line { -fx-stroke: #f0E68C; }
  		.default-color1.chart-line-symbol { -fx-background-color: #f0E68C, white; }
	</css>
</graphical>

A css tag like this would change the color of the first line to #185AA9 and the second line to #f0E68C (line 3 and 4 would still use default colors).
You can add as many lines as you need by specifying the corresponding number X in “.default-colorX.chart…”

← Stacked area chart / Pie chart →

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment