Mixing a line with pies or sectors - charts

A table consists of 4 fields:
X: time values in ascending order
Y: numeric value - double
A: numeric value - int
B: numeric value - int
I need to create a line chart using the X,Y values. And at each of the x,y points also show a pie/circle representing the A,B values as follows:
The centre of the pie is the x,y point.
The diameter of the pie is calculated from the values A and B.
The pie will have 2 different coloured slices, the size of each slice is proportion to the value of A and B.
After searching the documentations of lcjs, can this be done using Lightning Charts JS? if not, how about lc.NET?
Any hints is much appriciated.
Thank you

In LightningChart JS, I don't believe there is such functionality available.
Something like this should be possible (bar instead of pie)

Related

holoviz param and panel: how to get a slider that allows a discrete list of irregularly-spaced float values?

I am using holoviz param and panel to create a dashboard displaying gridded data on a map. I have two sliders to select grid coordinates x and y. Moving the sliders displays some data for the specified gridcell.
Right now I'm using two param.Integer objects to create the sliders with the bounds set to the dimensions of the xarray dataset containing the data. When a slider moves I grab a new slice from the dataset and update the dashboard.
I'd like my sliders to display the actual longitude and latitude coordinates, not the integer indices to the xarray dataset.
I can think of several ways to do this, but haven't gotten any of them to work.
update the displayed value on the slider to show the lat or lon. This keeps the internal slider value an integer but displays the float. I can't figure out what to update in the callback to change this value.
create sliders that display lat and lon as floats. The slider's allowed values would need to come from the list of lat and lon coordinates. The step between allowed values is not constant. So I'd need a float slider that allows, say, [74.0, 74.2, 74.5] and no other values.
Maybe (probably!) I'm just really dense but I can't quite see how to plug together the arguments to param.Number or param.Integer to make (1) or (2) happen.

Codename one - clickable bars in bar chart

I want to implement a bar chart that has clickable bars. To create a custom bar chart I created a class that extends BarChart.
Class BarChart has a method that might be useful:
clickableAreasForPoints(java.util.List<java.lang.Float> points, java.util.List<java.lang.Double> values, float yAxisValue, int seriesIndex, int startIndex)
I would like an explanation for the parameters. The doc. is a bit confusing to me.
Parameters:
points - the array of points
values - the array of values of each point
yAxisValue - the minimum value of the y axis
seriesIndex - the index of the series to which the points belong
startIndex - the start index of the rendering points
Are "points" x values and "values" the y values?
What is startIndex exactly?
EDIT:
All my data is stored in an ArrayList where the indexes represent X values and the value at an specific index is the Y value.
I think you don't need to override that. Sorry for the bad documentation we inherited that from the AChartEngine code that we forked so I'm not familiar with that either.
The API is there for internal use and it implements the protected void seriesReleased(SeriesSelection sel) callback.
I think you should be able to override that and get a callback when a column is clicked.

Understanding arrays and the use of operators

I've included a photo of what I'm working on. I'm learning to code using swift playgrounds on the iPad. I'm up to arrays. In the photo I'm to build an island and add a body of water. I'm not sure if you need the entire code to understand my question. (The bottom part of the code just removes some of the land and adds water)
My question is for the part where the greater than and less than operators are being used. I don't understand what coordinate.column > 3 actually means.
If you need more info I can upload another photo with the final product and complete code.
I've added another photo of the final product and it has the remainder code with it as well. I understand that < means less than and > means greater than. But there are no columns that are less than 3 in the final product or a row greater than 8 so what makes the use of the operators work to get the water to surround the island?
Basically, the function goes through each of the tiles of your continent grid and decides if it should be kept as land (added to the island array) or transformed into water) (added to the sea array).
Let's say that your top left tile is of coordinate (0,0) (column 0 and row 0), then it goes as sea, now let's take tile (3,3), it still goes as sea as the comparison is strict (>3 not >=3), tile (5,7) is going in island and tile (8,9) is going in sea.
I guess it's worth mentioning that column and row properties are numbers (of type Int - natural (whole) numbers).
The field is represented by a grid, in your case 11x11. Each block has a two-dimensional coordinate within that grid, represented by aforementioned column and row properties.
Indexes in Swift start from 0, so when you iterate over all blocks, their column and row values can be essentially numbers from 0 to 10.
Now, what you want to do is to select bricks in the middle of the grid. If you want the island to be 4 blocks in size each dimension, you do that by comparing their coordinates. Essentially, "island in the middle of size 4 bricks each dimension" is a collection of bricks located at coordinates 4,4; 4,5; 4,6; 4,7; 5,4; 5,5; ...., 7,7.
That "if" condition that you have is merely a good way of selecting these bricks.
The > and < symbols are boolean operators, so here I am assuming that coordinate.column would return a number, and then it'll be compared for either > or < and then return true if in fact coordinate.column is < or > 8 and 3 respectively.

Draw column chart using grouped data in Highcharts

I want to draw a column chart which represent below mentioned kind of data structure.
Marks-Range -> count
(0-20) -> 8
(20-40) -> 15
(40-60) -> 20
(60-80) -> 7
(80-100) -> 4
But the values i have is set of marks. (10,15,45,80....)
It is true that, this type of chart can be drawn in hi-charts by grouping those data manually. The problem is, once you do that you can't draw a plot line for x axis. I wonder is there any way to draw it by providing a grouping method like 'sum' similarly to data grouping option in Hi-stock charts. I can't use Hi-stock chart since my x values are not related to data or time.
Help would be appreciated.

kendo chart bar type series combined with line type series the chart reverts to a column type series

I'm trying to add a line type series i.e. "series.Line(s=>s.Name("goal")" to a chart -- this is being used to show a threshold of sorts. The remaining series are bar types series: "series.Bar(s=s.Name("Rate1") and "series.Bar(s=s.Name("Rate2") and "series.Bar(s=s.Name("Rate3") and so forth. If I remove the "goal" line code then the chart renders as horizontal bars as expected; however, if I include the "goal" line code then the chart renders as vertical columns (the default I assume). Any suggestions?
I think you're missing understanding something here.
A line will travel from left to right showing (normally) the progression of a value (normally over a period of time). meaning that their zero value with be on the horizontal axis.
The Bars have a zero value on the Vertical axis.
Therefore the 2 series types are incompatible. Therefore, Kendo changes the chart from "Bar" to "Column".
So basically, what you're looking for is a Vertical Line series type (which I don't think exists).
You may want to look at showing these as Bullet charts instead.
http://demos.kendoui.com/dataviz/bullet-charts/index.html
According to Telerik:
The chart item does not provide built-in support for Pareto chart, in
other words the chart item would not be able to make the percent
calculations for you and you should take care of that prior to binding
the chart. When this is done you can achieve the same functionality by
combining Bar and Line series types. To create a second Yaxis
marked from 0% to 100% try the following code snippet:
chart1.PlotArea.YAxis.AutoScale = False
chart1.PlotArea.YAxis.AddRange(0, 100, 10)
chart1.PlotArea.YAxis.Appearance.ValueFormat = ChartValueFormat.Percent
Here's an example of how to calculate percentages in advance using MySQL:
SELECT a.`Year`, #count := (a.`count`) AS `Count`,
#total := ROUND((#count)/(SELECT #total := count(`year`) AS `total` FROM `table` c) * 100, 2) as `% of Total`,
#cumulative := (#total + #cumulative) as `Cumulative %`
FROM (SELECT #cumulative := 0, `year`,count(`year`) AS `count` FROM `table` `data` GROUP BY `year` ORDER BY `count` DESC) a
ORDER BY `Count` DESC;