Dynamic Vaadin chart - highcharts

Is there a way to modify a Vaadin chart by moving a bar or a point from the chart itself? i.e. I have a bar chart with a certain value in one of the bars, I want to get a new value by dragging that bar to that new value.
There is something similar in this example, that is why I wonder if it is possible to extend this option to something like what I need.
Thanks!!!!

I assume that vaadin uses Highcharts if this is the case, maybe you can use plugins, if so I recommend:
http://www.highcharts.com/plugin-registry/single/3/Draggable%20Points
Source code in case you had to rewrite it:
https://rawgit.com/highslide-software/draggable-points/master/draggable-points.js
Regards.

Related

Charts in Vaadin14 don't seem to automatically resize when in splitlayout windows

In Vaadin 14.4.2, I have a scenario in which I have added a chart inside a splitLayout. However, when I, as a user, expand or shrink the splitLayout, the corresponding chart does not resize. The other components, such as the grid do automatically resize. Is there some "magic" configuration option to get the chart to behave like other components? (The screenshot below shows the chart not having resized, even though the grid beneath it did properly automatically resize.) (Also fyi, I call this: spectraChart.setSizeFull(); so the chart should be using up all the available space.) (Another FYI: I could probably "trap" the splitLayout resize even then redo the plotting, but it seems to me that this should ideally not be necessary in the a 'framework' solution such as Vaadin, since a chart is a component that should behave like other components, such as the grid.)
Yes, unfortunately that is true. You can workaround the issue by doing explicit JavaScript call to Charts to reflow when splitter position has been changed. The code snippet below finds all charts and reflows them:
innerLayout.addSplitterDragendListener(event -> {
getUI().ifPresent(
ui -> ui.getPage()
.executeJavaScript(
"Array.from(window.document.getElementsByTagName('vaadin-chart')).forEach( el => el.__reflow());"
));
});

iOS How to get size of chart grid?

I have used Charts library to make my chart. It really has ton of options, but I have been struggling to implement background for grid. I want to have gradient background, but just for grid part. I have done this by putting my view behind the chart view. I have printed _viewPortHandler.contentRect, and from there i positioned my view. Now, while this works, it is not most ideal solution. I would like to somehow at runtime have option to get gridview size, but since _viewPortHandler is internal, I see no option to do this:
Is there any better way to do this?

disable legend resizing of chart

Does anyone know the setting in highcharts (I've looked through the API but I can't seem to find it - maybe looking in the wrong place?) where I can disable the chart's ability to resize when I click on a legend item?
http://api.highcharts.com/highcharts#legend
If there are two lines on the graph, and toggle off one of them on the legend, the graph resizes to show the one line full sized. I want to prevent this functionality.
There actually is a simple solution to this provided for by the API:
chart: {
ignoreHiddenSeries: false
}
I'm pretty sure this is the behavior you desire.

charts in Partial view

I want to create partial views such that each partial view corresponds with one type of chart (say bar chart, pie chart etc.). The chart should be generated on the partial view just by passing the model to it.
I am working on the charts for the first time so not very much aware of the components/libraries available. All the example I seem to find on internet works by creating all the charts at the time of requirement and saving the for further use. Eg. http://czetsuya-tech.blogspot.in/2012/02/how-to-render-chart-object-in-view-in.html#.Uk_r_oaGoUU
Please let me know if any clarification is required.
While searching for similar thing I found the following that I think could be helpful to you as well:
http://forums.asp.net/t/1874913.aspx

Windows Phone Application Bar TextBox

I was wondering, if it is somehow possible to add a TextBox in the Application Bar area (the same way the Internet Explorer does), but I didn't find any information source about this. Have you any idea, how to accomplish this task?
You will not be able to add UIElements inside ApplicationBar as it is not derived from UIElement.
Alternatively, you can try adding a Grid at the bottom of the screen and color it similar to the ApplicationBar. Then add a TextBlock inside the Grid. This is just a workaround and not recommended as it is not according to the standards.
You can also check the following link:
http://www.maxpaulousky.com/blog/archive/2011/01/10/bindable-application-bar-extensions-for-windows-phone-7.aspx

Resources