Draw line/bar graph with mysql non time series data

Hi,

I would like to draw a bar chart based on the data available in mysql data base. I am using the mysql data source plug in with Table option to draw chart. I am getting below exception after writing

“No field name specified to use for x-axis, check your axes settings”

When i try to add filed name in axis tab, i could not add. Can you let me know how to draw bar graph?

Below is the data query which is getting data in 3 columns.
SELECT l.location_name, count(oi.quantity), oi.order_status from order_items oi, location l
where oi.location_id=l.location_id group by order_status;

2 Likes

For the graph you should use Time series mode and specify time_sec, value and metric fields. Look at this example:

SELECT clock AS time_sec, value, itemid AS metric
	FROM history
	where itemid=23295
		AND clock > UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL 6 HOUR)) AND clock < UNIX_TIMESTAMP(NOW())
	ORDER BY clock ASC;

I want to draw a normal histogram chart where x axis would be status like string values “Accepted”, “Rejected” comes from group by query. My requirement is not time series, it’s just static data which refreshes may be for every 5 min. Is it possible to draw graph with this information?

Hi, same issue here. MySql datasource and I’d like to draw a non time series hystogram chart. Is that currently possible? Any hint/example on how to do that? @madhup have you find a solution to this? Thanks.

Plotting of non-time series data is not currently supported according to Use graph with mysql and non time metrics, however, I too would love to be able to plot non time data.