[[PageOutline(2-5,Contents,pullout)]] = Creare bar/line/pie charts of query results == Description Create a bar/line/pie chart of an SQL query using the [https://plot.ly/javascript/ plotly.js] JavaScript plotting engine. The plugin egg contains plotly.js, ie. there are no external web references. A given wiki page can contain any number of plots. The plugin is at its very infancy (May 2018) so only a fraction of plotly's functionality is supported, parameter syntax may change a bit and error checking is very likely to be improveable. == !Bugs/Feature Requests Existing bugs and feature requests for TracYetAnotherChartMacro are [report:9?COMPONENT=TracYetAnotherChartMacro here]. If you have any issues, create a [/newticket?component=TracYetAnotherChartMacro new ticket]. [[TicketQuery(component=TracYetAnotherChartMacro&group=type,format=progress)]] == Download Download the zipped source from [export:tracyetanotherchartmacro here]. == Source You can check out TracYetAnotherChartMacro from [/svn/tracyetanotherchartmacro here] using Subversion, or [source:tracyetanotherchartmacro browse the source] with Trac. == Installation General instructions on installing Trac plugins can be found on the [TracPlugins#InstallingaTracplugin TracPlugins] page. == Usage {{{ [[yachart(id=first; title=Action statuses; query=SELECT status, COUNT(status) FROM ticket where type = 'Action' GROUP BY status)]] }}} ...will result in something like this: [[Image(newplot(1).png, width=300)]] === Parameters Note the unusual use of semicolon as delimiter character - this is chosen in order to avoid escaping commas in the SQL query {{{#!ini id = dom-name # The name of the HTML DOM carrying the chart. Mandatory. Must be unique for each macro call on a wiki page title = title-text # The headline shown above the chart. Default: blank. chart_type = bar|line|pie # Optional; default: bar query = sql-query # Mandatory width = pixel-width # Optional; default: 600 pixels height = pixel-height # optional: default: 400 pixels }}} In the query, the macro will replace the string `$USER` with the id of the user logged in. This can be used to display "my tickets": == Recent Changes [[ChangeLog(tracyetanotherchartmacro, 3)]] == !Author/Contributors **Author:** [wiki:thenor] [[BR]] **Maintainer:** [[Maintainer]] [[BR]] **Contributors:**