Reply to comment

QFlot a New QCubed Plugin to draw charts

QFlot 0.5 Demo

Hello folks

This is my weekly contribution to QCubed.

QFlot is a plugin that encapsulates a powerful Javascript-based graphing/plotting library called Flot (Flot homepage). Quoting the project's own goals, "The focus is on simple usage (all settings are optional), attractive looks and interactive features like zooming and mouse tracking".

To use QFlot to render a chart for bars, we just create an object of type QFlotSeries for each of the bars. We pass the name of the series to the QFlotSeries constructor. We then set the value of the DataSet property of the QFlotSeries to be the key-value pair that we deliniated earlier (the one where the key is the x-position and the value is the y-axis value). The last step is registering the QFlotSeries with your QFlot object by calling AddSeries(). That's it! You can now render the QFlot object on your template file by calling Render() just like you would on any other QControl.

To use QFlot to render a chart fro time series, we just create an object of type QFlotSeries for each of the bars. We pass the name of the series to the QFlotSeries constructor. We then set the value of the DataSet property of the QFlotSeries to be the key-value pair that we deliniated earlier (the one where the key is the x-position and the value is the y-axis value). The last step is registering the QFlotSeries with your QFlot object by calling AddSeries(). That's it! You can now render the QFlot object on your template file by calling Render() just like you would on any other QControl.

Take a look at it in action: see how easy it is to create a bar chart or a time series chart.

Enjoy it.

enzo

Reply

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <b> <address> <blockquote> <br> <caption> <center> <code> <dd> <del> <div> <dl> <dt> <em> <font> <h2> <h3> <h4> <h5> <h6> <hr> <i> <img> <li> <ol> <p> <pre> <span> <strong> <sub> <sup> <table> <tbody> <td> <tfoot> <th> <thead> <tr> <u> <ul> <tr>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
1 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.