-
Notifications
You must be signed in to change notification settings - Fork 898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial implementation of numeric report charts. #3894
Conversation
a5471b4
to
6f4a715
Compare
@martinpovolny This is looking pretty good . . . I did a report on disk space and noticed that maybe we could use the same formatting for the legend markers as we have in the report, as seen below: Note the legends with all the zeroes and no commas Report shows them as humanized, to MB, GB, TB, etc Same in column view with vertical axis legends This may be a jqPlots issue, but something to keep in mind for the future C3 charting is that with the flash charts, we could hover over a bar or chart item or node on a line chart and it would show a popup with the actual value. Would be a nice feature to keep. Pie charts for values look good and they have hover text over the pie slices, but same note about formatting of the values shown Pie chart using counts didn't fare as well, chart is blank. Column chart based on counts results in a line chart (strange) |
@martinpovolny Lots of feedback above, let's discuss where you're at tomorrow morning. Thx, Dan |
6f4a715
to
d715dc6
Compare
|
@martinpovolny more testing . . . Summary tab set to counts with no aggregations set, Chart tab should not allow values. Currently lets you select values, but the data column has a null choice. If no aggregations are being done, it should show Counts as a string with no choice and, of course, not show the column drop down. Here are the screenshots: Running the report with counts, not sure the output is correct. I can see some break lines in the report output and 1 of them lines up with the legend and has a value of 3 showing. The others, I think the name is too long so I can't see the count in the legend??? The chart shows percentages (which is probably ok), but hovering the mouse over the pie slices doesn't tell me which provider it is or the count, there is no popup. Basically, I can't tell if the chart matches the report. |
@martinpovolny Simple test, ran the "Vendor and Guest OS" report with the stacked bar chart (so 3d charts by count) and the charts look identical, so it seems those are working as before. Thought I would post some good news as well. :) |
@martinpovolny More good news, testing of column charts with values. Only issue here is from before, Y axis labels need formatting. Would be nice to have hover over values, but we can wait for C3. |
@martinpovolny Same issues as above for bar charts (X axis labels crazy) . . . they look pretty good tho: |
41f5999
to
b4e6f46
Compare
@dclarizio : Thinking about the use of For one we don't know the values for the ticks when calculation the chart. Then depending on type of chart we might have a problem with associating labels of the axis with the values in the chart. In jqplot you can have a formatter class for the ticks or you can use a special axis renderer for a couple of typical axis such as Date and Cathegory. Seems to me that the proper way would be providing formatters based on column types similarly to what we have in @himdel : do you know that ways one can use in the C3 to format axis values? |
@martinpovolny sure, I think this should be useable :) |
@himdel : http://www.jqplot.com/docs/files/plugins/jqplot-canvasAxisTickRenderer-js.html#$.jqplot.CanvasAxisTickRenderer.formatter so we need
@dclarizio : I'd probably create an issue for that at least is seems that we can use most of the work we do on the charts for both jqplot and C3 |
@himdel : do you know about some nice js library we could use? https://github.com/adamwdraper/Numeral-js maybe? |
Uh, looking at the formats, angular actually has most of these as filters but it'd be rather hacky to use here I guess... I've never heard of Numeral.js but looks like it could be useful for the numeric formats. We already have moment.js so we can use that for dates/times, and possibly something like sprintf-js (any version) to cover the rest? I can look more into it tomorrow .. sounds like simply reimplementing most of miq_report/formatting.rb in JS, right? |
@himdel : seems to me to be the best way to reimplement that in JS. In the reports we have way for the user to specify his/her format so we might actually end really reimplementing it so that we have the same format specification on both sides. |
@himdel : if you can look into it, I'd be glad. I can make the charts pass in the formating information for the right column, but If you could help with the javascript implementation of the formating function, it would be great help for me. Your experience with variety of javascript libraries would be usefull here ;-) |
@martinpovolny sure, no problem :) I'm assuming we want to keep the same function names mentioned in |
Support for strftime-like date format specifiers in |
@martinpovolny Minor detail in pie popup, not sure why it shows 2 values with : separator. Maybe legend has the value in the text, then it is adding the actual value again after the text in the popup. |
509fa7c
to
07ee471
Compare
ec6c6bc
to
74f62ec
Compare
@dclarizio : thanks for detailed testing! Now I:
|
@martinpovolny looks like a relevant spec test failure on vmdb. |
@martinpovolny Reran my saved chart report (with 2 series and non-stacked chart selected) with the new code, got this error again when chart is rendered for display (same as above with productization):
|
@martinpovolny Easy fix, remove (2D) from chart type names since there are no 3D charts: |
@dclarizio : on "Reran my saved chart report (with 2 series and non-stacked chart selected) with the new code, got this error again when chart is rendered for display (same as above with productization):" Can you, please, either create the report again from scratch or send me also a screenshot of the "Summary page". I cannot reproduce the error. Seems to me you must have only one sort criteria in the Summary (which the editor does not allow any more) -- so you have an invalid combination or I don't know. Just cannot create the situation on my box. |
71ecb5f
to
93ee3c4
Compare
@martinpovolny Still seeing the exception when rendering the values chart, screenshots below. Also IRC'd you a link to my DB. |
@dclarizio : please, retest with the last patch. I have also modified the spec to fail w/o the change. |
Checked commits martinpovolny/manageiq@1900db9~...97ceb99 with ruby 1.9.3, rubocop 0.33.0, and haml-lint 0.13.0 app/controllers/report_controller/reports/editor.rb
app/helpers/report_helper.rb
app/models/miq_report/generator/aggregation.rb
app/views/report/_form_chart.html.haml
lib/charting/jqplot_charting.rb
lib/report_formatter/chart_common.rb
lib/report_formatter/jqplot.rb
spec/helpers/report_helper_spec.rb
spec/lib/report_formater/jqplot_formater_spec.rb
|
@martinpovolny Exception is gone upstream. When productized, I get the following when rendering the chart with values (counts renders fine). Should be able to reproduce this with the DB I sent you.
|
@dclarizio : the above error seems as if you where loading a broken report from DB. That's a failure in parsing the saved chart column from the report definition. Also I was not able to reproduce this even when I tried your database, opened "Dan's Chart Tests" and then tried to edit your report (changing Value based to Counts based and more). Tried switching to product charts (should have no effect as the stacktrace leads to common code) and no change. Clicked on all reports that have "Dan" in the name too... |
@martinpovolny OK, so I created a chart report from scratch when productized and it worked just fine. I also copied the suspect chart and when I went to the summary screen, non of the aggregations were defined. Defined those and the charts worked there as well. Merging this now. |
Initial implementation of numeric report charts.
@@ -68,6 +71,27 @@ function jqplot_redraw_charts() { | |||
} | |||
} | |||
|
|||
function jqplot_pie_highligh_values(str, seriesIndex, pointIndex, plot) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should highligh be spelled highlight?
Replacement for #3528 w/o use of "Consolidation"
Work towards numeric report charts: https://bugzilla.redhat.com/show_bug.cgi?id=1213294