Is it possible to hide/show line chart with a toggle button in VizFrame - charts

Apologies in advance, I cannot share the code. I do have a screenshot.
[Screenshot][1]
I am using VizFrame vizType 'combination' which is a combination of columns and lines. I want to be able to hide/show just the line charts for the user to have an option. I have looked everywhere but cannot find a way. All I am able to do is hide data point labels which is not my requirement.
But please let me know if this is possible? If so, how can I can hide/show a line chart on click of a toggle button I have in my toolbar.
I'm using ui5 version 1.52

I'm afraid that if you cannot find a way to do that it means that it's not possible with the standard version of the control.
You have two options:
Extend the current VizFrame control you're using in order to
override/implement what you need
Use a third-party control to
display charts. I would recommend you to check out my implementation
of openui5-chartjs

Related

React AG Grid - How to customize tool panel

We are using Enterprise AG Grid in our react application. I could not find anything on below in official docs of Ag Grid.
How can we hide all columns at once, not using column api but user should be able to do it, may be a hide all check box in tool panel?
Is there any way to customize tool panel? So that we can add more options specifically for #1.
Once we hide all the column and then add it back from toolpanel. Is there a way that we can force new column to be added in the last instead of its original position as per coldefs?
Any help is appreciated, apologies for long text here.
Update 1.
I was able to add workaround for #1, by using Grouped columns and setting groupheaderheight to 0. Added all columns in one group and then a check/uncheck for all is available in tool panel.
Update 2:
Most of it is supported by Ag-Grid now. Please refer their latest build.
Most of these features are supported by AG-Grid (latest build) out of the box (except #3, which is very specific to our application). Please refer AG-Grid's documentation for more details:
Tool Panel Component

How can I add a custom column menu tab in ag-grid?

Is there a way to add a custom column menu tab with my own favourite icon which on click would render my custom react component?
something like
myColDef.menuTabs: ['generalMenuTab', 'filterMenuTab', 'myCustomMenuTab']
FYI I'm using v12.0.2
What you're after can't be done I'm afraid. The grid supports React components in all sorts of ways (renderers, editors, filters etc), but not via the column menu.
I've updated the docs page to remove the gibberish issue - it'll be fixed properly in the next release, thanks for highlighting this.
This would be helpful to have. In particular for us, we'd like to filter based off row properties, and not row values. Creating our own tab to filter by cell colors that we have assigned with our own set of labels would be useful.
I agree that it would be a nice feature to have. Apparently, there's no quick out-of-the-box solution to do it. The only workaround I see is to implement your own custom Header component which would display any buttons your want.
There you can put a button to open your own custom menu, which you can implement as any regular UI component. It also means you'll need to manually implement all standard menu options that Ag-Grid provides out of the box if you need them.

How to position legend chart labels?

Is it possible to change the default positions of the legend labels around the jasper reports charts? Currently I have a following kind of chart being created:
I would like to move this [hoursNormal, hoursTravel, hoursOvertime]-box from under the chart to the right side of the chart. Another thing I would like to do is to replace this [hoursNormal, hoursTravel, hoursOvertime]-box by label "month". I just don't see any tools for moving these positions in Jasper studio chart creation wizard, and to me also the xml looks like so static that I don't believe tinkering it would help me.
Hopefully I'm wrong and there is a easy solution?
Move the legend to the right and other option of the chart can be find in the Properties View.
Click the chart, to view Properties for the chart. Navigate the different properties tabs to set what you need.
Example
If you need more advanced feature on the chart you need to use a customizer class see this as example: How to put benchmark line on barchart?

How may I force a redraw of all Vaadin charts in a dashboard to toggle dataLabels on or off?

How may I force a redraw of All Vaadin charts in a dashboard to toggle dataLabels on or off?
I would like to allow my app user to add/remove chart dataLabels for All charts on their dashboard; forcing a redraw similar to when changing themes say from VaadinTheme to GridTheme.
How may I achieve this?
How does changing themes work under the hood, what is the source code that does this?
e.g.;
I know I could redraw a single chart individually by resetting its plot options and then redrawing it:
.
.
.
PlotOptionsColumnRange columnRange = new PlotOptionsColumnRange();
columnRange.setDataLabels(new Labels(true));
columnRange.setDataLabels.setFormatter(/* some javascript about this.y */);
conf.setPlotOptions(columnRange);
chart.drawChart(conf);
But I want to do it for All charts on a dashboard; like having a Listener that does
ChartOptions.get().setTheme(new VaadinTheme())
then
ChartOptions.get().setTheme(new GridTheme())
and viceversa
Maybe I can reset the plotOption dataLabels then reset the theme to force a redraw with the new dataLabel state?
Please advise...
p.s.
I don't want to make changes to my user saved data in my database, i.e., I don't want this label toggle to be persistent. I want to toggle dataLabels just like a toggling themes.
Please look at:
http://demo.vaadin.com/charts/#ColumnRange
to see what I mean.
Ok, two solutions:
A coworker of mine that worked on the Dashboards helped me with the first answer to this question.
Basically, you have to clear all charts, then iterate through ea. chart in a particular dashboard (stored in the DB), and rebuild ea. chart w/ your decision to have or not have a dataLabel, placing it back in that dashboard; but I wanted to avoid this as it might take a performance hit.
Also I later got a response from Pekka of the Vadding team, as follows:
'You can easily hide the dataLabels with basic css. For example, if you can apply a stylename "dataLabelsHidden" to you UI, then you could write in your stylesheet a specific enough rule for hiding the labels. I quickly tested the demo with this:
.v-ui.dataLabelsHidden g.highcharts-data-labels {
display: none;
}
This way you won't have to update all your charts when the labels on/off is triggered.'

Fusion charts dynamic clickable

I have a scenario where in I am using fusion chart which has a multiple line chart in one fusion chart. I want to create a clickable line chart where in clicking on label that particular attribute will be displayed in graph. So basically each line chart in graph is dynamically displayed with click of button for each line chart. I hope you get my requirement. Any help will be really appreciated.
I hope I have understood your requirement correctly.
As far as I know, FusionCharts v3.2 has something similar to what you require.
From the documentation,
Interactive legends in charts that allow for selective showing/hiding of data series (or slicing, in case of pie charts)
You can see a demo of this at FusionCharts gallery