Using Anychart to plot volume on the same plot window of stock price - candlestick-chart

I am exploring AnyChart JS to plot candlestick stock chart. While Anychart.js has a dedicated component to plot trading volume on a second plot window, I am used to seeing volume plotted at the bottom of the price chart window. It just looks cleaner this way. The document does not mention plotting volume like this but that it can clearly be done as demo on one of their pages. ( page here: https://www.anychart.com/products/anystock/overview/ )
So I am wondering if anyone know of an "official way" of plotting volume in the same window of stock price or we have to hack it by plotting a second series (perhaps a third series even so we can show different colour of up and down days).

The source code of this sample is available in the AnyStock gallery. The idea is to create a second series (Volume) on the plot and apply a custom series height and logarithmic scale to it.

Anychart support team provided the source code as per the sample shown in the earlier comment.
You need lines 48 - 67 in the sample -
playground.anychart.com/BVHPxBya – AnyChart Support 2 hours

Related

Vega Lite Repeat Charts and Labeling

See code here
I am working on a prototype dashboard and had fun so far building it with Vega Lite. However, I hit a road block on the following points:
I want to add a P10 and P90 line on all the bar charts. I have followed the tutorial for the single bar chart with line but I was not able to work it with repeat charts.
Adding labels on every single bar similar to this tutorial but could not make it work with the repeat charts
I want to add a second pie chart which will be identical to the one I have except that the values will be multiplied with a constant. I tried a nested concat but it didn't work. The charts disappeared without an error.
I failed to replicate this tutorial for selecting and higlighting and I would appreciate the help
Is it possible to add filtered data tables in Vega or Vega lite?
Check the code here
For adding the line on bar chart, you can provide layer config as an array inside the spec object and provide multiple marks for it.
Similarly, add mark config with value text inside the layer. So, that will help to add the labels.
A similar pie chart is added at the bottom but the values of this pie chart is achieved by multiplying it with a value. For example: 5. The pie chart gets disappeared because it share the same axis or we can say theta config. To fix that you need to add a resolve config. Check the documentation for resolve config.
The selection configuration given in this tutorial has been added in the layer, where the mark bar is provided.
In vega or vega-lite, the data can be filtered using the transform config. Its use is somewhat similar to the calculate config which was used in your code. Check the documentation for filter transform.

Extracting data from shapefile for polygon

I am working on my masters thesis trying to determine habitat prefrences for wild turkeys. I have polygon shapefiles which represent areas that turkeys used during different breeding periods. These polygons are all circular and vary from 300m to 1500m radius.
I have data to be extracted in the form of polygon shapefiles that I need to extract for each of the above mentioned areas. For example, one of my habitat data shapefiles maps out areas that were burned. This is a polygon shapefile with 100% coverage. The shapefile has an attribute Y_N_U where Y= yes, N=no and U=unknown. For each of my used circles I need to extract how much area was burned, not burned, and is unknown (can be in actual meters squared or % of the area .
Thanks for the help.
I would use union tool and union all the layers together.
Use select by attribute to and delete the polygons except for your target area (habitat polys).
Use dissolve tool on the above layer and run it with the "Y_N_U" attribute and the FID field of the habitat poly selected.
Then create a new field such as "Area_sqmeter". Run calculate geometry on that field - choose square meter for the unit.
Use the select by attribute tool under the selection button on top.
After this select the area you want. Right click on layer's name in the table of contents. Go down to the "data" tab and when it expands, click on "extract data". Be sure to choose to extract what is selected and extract it to a new file geo database.
Then you can edit it from there at your heart's desire while the original is still there.

provide custom datalabel to google chart using apps script

I am creating a google scatter chart using google apps script EmbeddedChart Option.
Below is the datatable that I want to assign to the chart.
The first column goes to x axis labels and graph is getting generated for NPP and Noise values.
NPP Noise
-1.28, -7.84625, 2.33
-1.83, -12.561, 4.55
I need to set the datalabels for each scatter point in the graph and its working with setting "datalabel" to "value". But my requirement is to display different text as data labels not the value. Like below, I have added a column datalabel and given the values for each point.
NPP Noise DataLabel
-1.28, -7.84625, 2.33, Spring
-1.83, -12.561, 4.55, Hibernate
Can I display this labels as datalabel on the scatter points?
Code:
var chart = NormalGraphSheet.newChart()
.setChartType(Charts.ChartType.SCATTER)
.setPosition(2, 1, 7, 6) .addRange(normalPlotCalculationsSheet.getRange(tableStartRow,2, noOfCols, 4))
.setOption('series', {0: {pointSize: 14, color: 'red'},1: {pointSize:0},2: {pointSize: 10, color: 'green'}})
.setOption('trendlines', {1: {type: 'linear',color:'blue',lineWidth:2,opacity:80}}).build(); NormalGraphSheet.insertChart(chart);
Okay, so I googled and looked around the community for quite sometime, and managed to see this very similar post, only difference I can see is the data you guys use, the first top answer suggests just adding a Tool tip for each of the data points, which I'm guessing is not what you want.
The second top answer suggests using the Visualization API, which is the same as to this accepted answer from WebApps Community (with a similar concern), though the second answer seems to demonstrate that custom data labels are automatically included when formatted in a specific way:
First column: X axis
Second column: Y axis
Third column: Data label
When looked at in the customization tab via spreadsheets, the value of Data Label is shown as Custom though when trying to manually do a chart, and going to the Data Label drop-down again, it only shows None and Value. So I think, since you are doing the chart via the script, it better for you to use the Visualization API. Hope this helps you somehow. Good luck.

Generate overlay map image from geo data

I need to generate a transparent image to apply on map similar to these:
Image_1or Image_2
I need to generate this image from a dataset: I have many data points (with lat and long) and I would to generate this image (server side) to show density on map of my data.
Know you something (libraries, or best way to solve my problem) about it?
Those are heatmaps. Google Maps already has this capbility, so you should check out their sample and the documentation. It can be as basic as loading in your data points and applying them as a layer or you can do much more customization.

Library to generate heat map map overlay based off point values not point densities

I have a set of data points where each point is expressed as a lat/lng. Each of these points has a value associated with it that changes over time. I would like to produce a heatmap animation overlay on top of a map that reflects this change in value over time. Note: I am fine with producing a series of static "snapshots" and piecing them together frame-by-frame into an animation, so the heatmap library itself does not have to support animation.
My first attempt was to use the HeatMapLayer which is a part of the Google Maps visualization library. However as per the question Heatmap based on average weights and not on the number of data points, it would seem that this particular visualization library insists on weighing the density of points in determining what color to use surrounding a given point.
I am after a solution that only considers the value of the points rather than the density. To give an example, assume one wanted to visualize the ambient temperature of a city over time, but there were more thermometers installed in some parts of the city than others. You wouldn't want a small area with many thermometers installed to show up red just because there were many thermometers - you'd want it to show up red only if it was hot there.
Basically, I want a single color for each of my points that reflects the intensity of the point's value, and then a gradient spatial transition between any two point's colors. It doesn't have to be Google Maps - the key criteria is just i) must base colors off point values not point densities ii) must overlay on top of a map and iii) ideally has a programming abstraction that talks in terms of lat/lng's, rather than requiring manual conversion to e.g. Euclidean space.
global tempsYou can do this with multiple:
gmaps.symbol_layer
and then just layer them up:
fig_gmap.add_layer(red_markers)
fig_gmap.add_layer(yellow_markers)
fig_gmap.add_layer(green_markers)
fig_gmap.add_layer(blue_markers)
I haven't been able to successfully pass a value that gives me a good temp color for the heat maps, just always get some variation on the density thing, which is a one trick pony. It would be nice having a way to do this and animate the marker icon without java.
Maybe you should try heatmap.js. It has a plugin for Google Maps: http://www.patrick-wied.at/static/heatmapjs/plugin-gmaps-layer.html
This library uses datasets made of coordinates and values. I think it will behave the way you described.