Some questions as for vue-chartjs - vue-chartjs

In Laravel 5.6 / vuejs 2.5 application I use vue-chartjs, but my charts looks like :
https://imgur.com/a/ru1dXlm
I want some more:
having several items(artists in my case) I want to see them half-transparent, just as in first example here http://demo.vue-chartjs.org/
having points with values shown as in first example at link above
I need to see all labels in x-direction( I fill labels parameter ) for here
If there source code of demo examples of link above > I searched and did not find...
Thanks!

Well, you should find everything you need in the documentation of chart.js and vue-chart.js
http://www.chartjs.org/docs/latest/
http://vue-chartjs.org/#/home?id=resources
You can add rgb values as a background color to make them transparent.
You can also use gradients as its just a canvas element.
Here is a tutorial:
https://hackernoon.com/creating-stunning-charts-with-vue-js-and-chart-js-28af584adc0a?source=user_profile---------5----------------
Here is the source code of the vue-chartjs demo page:
https://github.com/apertureless/vue-chartjs-demo
(It's a bit outdated as with v3 the creation of chart components changed a bit)
It seems you did not filled the labels correctly.
{
labels: ['Here', 'are', 'your', 'x-axis', 'labels'],
datasets: [
{
label: 'artist 1',
backgroundColor: 'rgba(75, 192, 192, 0.2)',
data: [0, 1, 2, 3, 4],
},
{
label: 'artist 2',
backgroundColor: 'rgba(255, 99, 132, 0.2)',
data: [0, 1, 2, 3, 4],
},
],
}

Related

Is it possible to display in a chart the axis in reverse, from example the x axis from right to left and the y from left to right? React-chart-js

I am trying to reverse the axis in a chart,what i want is to have to line of the chart running from left to right and the date.now() from right to left? How can i accomplish that?
I have tried to do x: {
reverse: true
},
y:{
reverse: false
}
Actually, you can reverse to arrays. In addition, depending on the situation, You can add new items in reverse.
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'].reverse(),
data: [65, 59, 80, 81, 56, 55, 40].reverse(),

Loading Mapbox Style object from local json file in dash app

Trying to set a Mapbox style from a local JSON file in plotly dash app.
mapbox_token = <mytoken>
local_style=
json.load(open(application_root_path+r'/pages/campaignmap/mapbox_style.json'))
fig = go.Figure(
go.Scattermapbox(
mode="lines", fill="toself",
lon=[-10, -10, 8, 8, -10, None, 30, 30, 50,
50, 30, None, 100, 100, 80, 80, 100],
lat=[30, 6, 6, 30, 30, None, 20, 30, 30, 20, 20, None, 40, 50, 50, 40, 40],))
fig.update_layout(
dict1={"mapbox": {"accesstoken": mapbox_token}})
fig.update_layout(
showlegend=False,
margin={'l': 0, 'r': 0, 'b': 0, 't': 0},
mapbox_style=local_style
)
Based on the documentation on the plotly website Mapbox Map Layers in Python (see image below) this should work. The JSON file contains the export of the style from MapBox and it works fine when I use the service URL (second last dot point in image).
I've tried loading the JSON as string, dictionary and file path in the mapbox_style parameter with no luck.
Any ideas on how to make it load?
I've tried the same things you've described and had no luck. I can provide a style URL and it works perfectly, but if I download that style and provide just the style.json representation of that same style, I can't seem to get Plotly to recognize it...

Altair plots no longer displaying in VS Code

My Altair plots are no longer displaying in VS Code. Is anyone else having this issue? Matplotlib / pandas plots still show normally.
I used the simple bar chart example:
source = pd.DataFrame({
'a': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],
'b': [28, 55, 43, 91, 81, 53, 19, 87, 52]
})
I can plot a pandas bar chart and get it to display:
source.plot.bar()
But I get no output when using Altair:
alt.Chart(source).mark_bar().encode(
x='a',
y='b'
)
I think that you need to call the chart, so first you need to save the chart as a variable and then call.
Chart1=alt.Chart(source).mark_bar().encode(
x='a',
y='b'
)
Chart1

how to linegraph using result from the previous page

Can i create line graph which is the data get from previous page. I have done a calculation on my previous page. I would like to create line graph using the result and times. I face the problem to adjust the coding below because the coding below show the data was fix.
series: <LineSeries<SalesData, String>>[
LineSeries<SalesData, String>(
dataSource: <SalesData>[
SalesData('Jan', 35),
SalesData('Feb', 28),
SalesData('Mar', 34),
SalesData('Apr', 32),
SalesData('May', 40)
],

Formatting data for CoreImage CIColorCube

I'm trying to apply arbitrary 3D Luts to images on iOS, but I'm stuck.
I can't for the life of me figure out how to correctly format the cube data for CIColorCube.
I've done what I can based on the brief screen grabs I've taken from the WWDC videos, but what I really need is some sort of working template to go from.
Are there any docs with an example of a hard coded cube rather than the procedural ICC generated ones shown in the ImageApp sample code?
Right now my cube data looks like what you see below (with the middle chopped out for brevity).
Its throwing the error:
"Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<CIColorCube 0xb46a850> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key inputCubedata.'"
Any help would be much appreciated, I'm tearing my hear out over this one. I can't find any sold examples of what CIColorCube is expecting (As in a working example, not just a explanation).
uint8_t color_cube_data[4096*4] = {
0, 0, 0, 1,
17, 0, 0, 1,
33, 0, 0, 1,
51, 0, 0, 1,
68, 0, 0, 1,
84, 0, 0, 1,
102, 0, 0, 1,
119, 0, 0, 1,
-----etc etc etc
153, 255, 255, 1,
170, 255, 255, 1,
186, 255, 255, 1,
204, 255, 255, 1,
221, 255, 255, 1,
237, 255, 255, 1,
255, 255, 255, 1
};
I can't help with all your problems without more info, but I think your current error may be cause by this. Make sure the line of code setting your cube data reads like this...
[_colorCube setValue:color_cube_data forKey:#"inputCubeData"];
not this...
[_colorCube setValue:color_cube_data forKey:#"inputCubedata"];
3D LUT has to be wrapped into NSData before passed as an argument to the CIFilter. Cube values are in range [0.0 : 1.0]
NSData * cube_data = [NSData dataWithBytes:color_cube_data length:4096*sizeof(float)*4];
[filter setValue:input_image forKey:#"inputImage"];
[filter setValue:cube_data forKey:#"inputCubeData"];
[filter setValue:[NSNumber numberWithFloat:16] forKey:#"inputCubeDimension"];
Value for inputCubeDimension is strictly power of two.