JAVAFX 8 Chart: get style of existing plotted series - css

This is a follow up to this question which has to that day still 0 answers.
What I really want to do is having in a tableview, a column that has the symbol for the plotted data corresponding to the objects in the table view row. I have managed to generate the colours supposedly followed by the JavaFX chart. The issue I have of course is that my own colour generation works (it goes back to the first colour without fail after 8 elements), when the one from the chart has the issue outlined in my unanswered question.
So.
I would like now to try to pick up the style actually applied to each series of the chart independently from pre-supposed rule about the default order of colours. How do I do that?
This way I could apply those to my table view and even if the colours randomly change upon reloading then at least I will know what I am looking at.
Thanks in advance for your help.

After a bit of research I found that the following code allows me to get what I want, supposing I am interested in the series at index intitem:
plotswingschart.getData().get(intitem).getNode().getStyleClass();
This will produce a ObservableList containing the following string values (here example for the series at index 8 (9th series)):
chart-series-line
series8
default-color2
From this I can then get the information that I need. that is the colour actually applied to that curve. I can then generate a symbol to be used in my tableview.
I would still be interested in an answer to the question linked, which prompted the present question...

Related

Creating a grid on a map in R using grid points

I'm clearly struggling with this problem for a day now and can't seem to find a nice solution to it. I would really appreciate some help and I'm really a novice in R (since last week).
Problem 1:
I have a set CSV representing grid points which I can parse into a data frame (pointname, latitude, longitude).
Eg:
name,latitude,longitude
x0y0,35.9767,-122.605
x1y0,35.9767,-122.594
x2y0,35.9767,-122.583
x0y1,35.9857,-122.605
x1y1,35.9857,-122.594
x2y1,35.9857,-122.583
x0y2,35.9947,-122.605
x1y2,35.9947,-122.594
x2y2,35.9947,-122.583
The points in this file represent the lower left corner and are arranged in row major format, meaning lowest horizontal grid points first. Each point is a certain great circle distance away from its neighbors (1km). I want to create a grid overlay on a map which I've plotted using ggmap.
What I've tried or considered:
map.grid() - this is really not useful to me as I'm not looking for any kind of projection.
geom_vline() and geom_hline(). These look good but I don't have constant x and y intercepts on a plane. Moreover, once I create a grid, I'd like to use the grid to color against a density.
geom_rect() and geom_tile(). These look really promising and may be what I want. But I'm not able to find a good way of working with these.
I'd like to fill these grid boxes later with another parameter. Any suggestions on how I can create such a grid? This may be a trivial question but I don't know a lot of R yet.
Problem 2:
How can I store or hold such a grid so that I given a point (lat,lon), I can quickly get to that grid. In fact my whole back end is in C++ and can directly output the grid name x<n>y<n> directly against a given search point. I somehow am finding it difficult to count such points against grid points so that I can fill grid with a representative color.
I'm not sure if everything of what I'm saying is clear. Please tell me if I've to clarify something.
Also note that I've Googled quite a lot and not found relevant answers although some looked close.
Eg: This, ThisToo
Thanks for the help!

How to create a dyraph with multiple x-axis labels?

I'm working with a lot of rank data that would benefit from a way to simultaneously display its respective year on the x-axis. For example, I want to create the following graph adapted from the dygraph gallery:
Note how the rank information (red arrow) for a particular weekend (green arrow) are both displayed on the x axis.
I know this might not be possible with dygraphs now, at least it wasn't available in these demos, so I guess my follow up question would be are there any plans to make this possible (how about in the [r] {dygraph} package)? Apparently a plotter called flot can do this.
UPDATE 1
If indeed this feature does not exist yet, then the following, although potentially obvious to Dygraph developers, is a thought for accomplishing the task easily (perhaps I'm wrong). At first I thought it would be necessary to provide input data of the form shown in Table A
However such input is a major deviation from the existing Dygraph parser model who expects one abscissa. Such suggests that a modification to the parser to accept a "Dual Label" option, requiring that both labels be contained in a single abscissa element as in Table B, would be easier. Thereafter, with the option specified, the parser would manage CSV as it usually would with the exception that it is now "bin cognizant" and detects division between labels 1 and 2 by use of an acceptable delimiter (in this case a single quotation mark - maybe not the best choice) and divisions between label 1 abscissa elements by name change. Behind the scenes each point gets its unique x coordinate and the "Dual Label" option causes the dygraph to visually scoot up a couple pixels to accommodate an extra label. Not sure how to handle full zoomed scrolling put simply leaving a label 1 element centered until an adjacent label 1 element comes on screen is an option.
Dygraphs rule!
There's no simple way to do this with dygraphs now. As you say, there's a fairly deep assumption that there's only a single x-axis.
Your best bet would be to either modify the existing legend plugin to do this, or to create a new plugin which renders just the "Weekend 1", "Weekend 2" line. While the plugins API isn't official yet, it is at least somewhat documented.
If you get this to work, please share your code!

How do I get the current filter for a crossfilter dimension?

I have a crossfilter.dimension. How do I get the current filter set on it (for example if it was set by a brush from a chart)?
Example:
dimension.filterRange([1,15]) // returns dimension
Given this filtered dimension, how do I get the values 1 and 15 out?
Stumbled on this old question because it is the top-voted unanswered crossfilter question, with 1k views!
This feature was contributed by Thomas Gillet in 1.4.5 as dimension.currentFilter()
The tough remaining problem: when you get beyond filterExact and filterRange, the more complex filters use filterFunction. You might be able to retrieve the function but functions are essentially opaque.
For example, if you are using dc.js, it will generate a filter function when
multiple items are selected in pie chart, row chart, or bar chart with ordinal dimension
the chart has a two-dimensional filter, like the scatter plot or the heatmap
For this reason, if you're using dc.js, you should use chart.filters() instead.
Thank you, Gordon. This was really helpful to me! One note - your link is correct -- it goes to filters(), but the text displays as chart.filter() which is in the API, but doesn't return multiple filters on a chart. I tried to edit your answer, but it won't allow single character changes!

Need a fast dataset 2D-viewer/plotter for large datasets

I'm searching a data viewer/plotter for some data I've generated.
Facts
First some facts about the data I've generated:
There are several datasets with about 3 million data points each.
Each dataset currently is stored in ascii format.
Every line represents a point and consists of multiple columns.
The first two columns determine the position of the point (i.e. x and y value) whereas the first column is a timestamp and the second is a normalized float between 0 and 1.
The other columns contain additional data which may be used to colorize the plot or filter the data.
An example data point:
2012-08-08T01:02:03.040 0.0165719281 foobar SUCCESS XX:1
Current Approach
Currently I am generating multiple png files (with gnuplot) with different selection criteria like the following ones for each data set:
Display all points in grey.
Display all points in grey, but SUCCESS in red.
Display all points in grey, but SUCCESS in red, XX:-1 in green; if both SUCCESS and XX:-1 match use blue as coloring.
Drawbacks
With the current approach there are some drawbacks I'd like to have addressed:
I can't easily switch on/off some filters or colorings because I have to generate a new png file every time.
I need to use a limited resolution in my image file because the higher the resolution the slower is the viewer. So I can only zoom in to a limited level of detail.
I don't have the raw data available in the png viewer for each point. Ideally I'd like to have the data visible on selection of a point.
Already tested
I've already tested some other approaches:
Gnuplot itself has a viewer but it can't handle that amount of points efficiently - it is too slow and consumes too much memory.
I've had a quick look at KST, but I couldn't find a way to display 2D data and I don't think it will meet my wishes.
Wishes
I'd like to have a viewer which can operate on the raw data, can displays the points quickly if zoomed out, can also zoom in quickly and as well should resolve the aforementioned drawbacks.
Question
So finally, does anybody know of such a viewer or has another suggestion?
If there isn't a viewer some recommendations for programming it myself are welcome, too.
Thanks in advance
Stefan

Creating a chart in ASP.net

I am working on a project and need to add an additional image using the asp:chart control. Unfortunately, I've never had to use this control before and it's a bit complex to use, so I need some help.
Basically, I need to create a stacked Column chart with two legends and two columns. The first column is "income" and stacks three values. (Wages, interest and other.) The second column is "expenses" and stacks two values. (Mortgage, Other.) Each value has it's own value.
The legend for income should be on the left, the column for expenses to the right. These legends should display the texts and values for it's related value plus a 'Total' label with value.
For this task, I only have to deal with 5 values over two columns but the asp:chart control is huge and I'm drowning in all it's options. And they want it ready yesterday, so no pressure. It's already overdue... :-)
No, it's not homework. If it was, I would have practical documentation and the additional how-to information. Since my Boss expects me to add this, he just gave me absolutely no information to work with, except for the code which already contains several other charts, none of them like this one and all done by previous victims who each used their own coding style. Basically, the project code is a huge mess so useless as documentation. (And amazingly it works, as long as I only use asp:chart for these graphics.)
The biggest problem I'm having is stacking the values correctly. Since I have two columns and 3 values, it could be solved with three series, each with points for column 1 and 2. Unfortunately, this puts income and expense in the same label, which is not what I want.
If I make it 5 series, for every value one point, then the second column doesn't start at the right height. So that won't work either.
You can download Samples for Chart Control from msdn which give you complete in depth knowledge of how to use them
http://archive.msdn.microsoft.com/mschart/Release/ProjectReleases.aspx?ReleaseId=1591
For learning see these blogs as well
https://web.archive.org/web/20211020203246/https://www.4guysfromrolla.com/articles/072209-1.aspx
http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx

Resources