I needed to individually customize each xaxis charts, name, type etc. ...
eg:
dataObj.data1 = [5,8,9,6,7,4,5,6,3,2];//...column (mm) eg
dataObj.data2 = [2,5,9,6,3,5,4,1,7,5]; //...area (ÂșC) eg
dataObj.data3 = [4,5,8,9,6,3,5,7,4,2]; //...spiline (hpa) eg
dataObj.data4 = [3,6,9,8,5,2,1,4,7,8];
dataObj.data5 = [1,2,4,5,7,8,9,3,6,4];
http://jsfiddle.net/jlbriggs/XQu8E/11/
is that possible?
thank you very much
I finally found the solution in this other example:
http://fiddle.jshell.net/jlbriggs/TRd7f/
Related
I have a requirement where i have to show custom points on x-axis instead of dates values. Also same custom data points needs to be shown on navigator as well. In the below Js fiddle, i am converting data (Per13/2016 etc) into equivalent date values and then binding the chart using converted date values.
Below is the link of the JS fiddle:- Fiddle link
In the Js fiddle, i am showing Per1,Per2 etc.on x-axis and same has to be shown on navigator as well.
Now i am facing problem with the navigator,when i changes the range using slider ,the x-axis labels changes but not according to the range selected.Also tool-tip formatting is getting changed.
Can you please let me know how to handle this scenario and best way to do the same.
//few code lines to post fiddle link
xAxis: {
labels: {
formatter: function () {
if(fiscal13){
var perDate = new Date(this.value);
return 'Per' + (perDate.getMonth() + 1);
}
}
}
}
I am not sure if I am right, but I think you are overdoing this.
Let's keep original data, so remove fiscal13Data.Data.forEach(function(item) { .. }); function. And When creating data, use simply index of the point as x-value:
var cost = [],
usage = [],
dataLength = fiscal13Data.Data.length
i = 0;
for (i; i < dataLength; i += 1) {
// need to sum costs
cost.push([
i, // the index
fiscal13Data.Data[i]['Cost'] // cost
]);
usage.push([
i, // the index
fiscal13Data.Data[i]['Usage'] // Usage
]);
}
Now you can get to the "Per13/2016" strings in a simple way in xAxis labels' formatters:
var str = fiscal13Data.Data[this.value].Date;
In tooltip formatter, it is almost exactly the same:
var str = fiscal13Data.Data[this.x].Date;
And here is working demo: http://jsfiddle.net/qneuh4Ld/3/
Note: You data looks a bit strange - don't you want to sort it first? Also, you have twice every date (e.g. "Per13/2016" - once for "water" and once for "electric").
I am trying to somehow replicate the range bar chart here.
I've found this reference but I don't fully grasp the code.
What I have is a series of task (sometimes accomplished in different periods).
let d = [("task1", DateTime.Parse("11/01/2014 08:30"), DateTime.Parse("12/01/2014 10:30"));
("task2", DateTime.Parse("15/01/2014 09:30"), DateTime.Parse("16/01/2014 10:30"));
("task3", DateTime.Parse("11/01/2014 08:30"), DateTime.Parse("16/01/2014 10:30"))]
let chart = d |> FSharp.Charting.Chart.RangeBar
chart.ShowChart()
I am struggling to understand the logic of the API.
I have also tried:
let chart = new Windows.Forms.DataVisualization.Charting.Chart(Dock = DockStyle.Fill)
let area = new ChartArea("Main")
chart.ChartAreas.Add(area)
let mainForm = new Form(Visible = true, TopMost = true, Width = 700, Height = 500)
mainForm.Controls.Add(chart)
let seriesColumns = new Series("NameOfTheSerie")
seriesColumns.ChartType <- SeriesChartType.RangeBar
type SupportToChart(serieVals: Series) =
member this.addPointXY(lbl, [<ParamArray>] yVals: Object[]) =
serieVals.Points.AddXY(lbl, yVals) |> ignore
let supporter = SupportToChart(seriesColumns)
supporter.addPointXY("AAA", DateTime.Parse("11/01/2014 08:30"), DateTime.Parse("12/01/2014 10:30") )
which results in
System.ArgumentOutOfRangeException: You can only set 1 Y values for
this data point.
Has something changed in the API since then?
I'm not entirely sure that F# Charting is currently powerful enough to be able to reconstruct the above chart. However, one of the problems seems to be that it treats dates as float values (for some reason) and incorrectly guesses the ranges. You can at least see the chart if you use:
Chart.RangeBar(d)
|> Chart.WithYAxis(Min=41650.0, Max=41660.0)
Please submit this as an issue on GitHub. If you want to dig deeper into how F# Charting works and help us get this fixed, that would be amazing :-)
The trick is initializing the Series with
let serie = new Series("Range", yValues)
where yValues defines the max number of "Y-values".
I have this piece of code that was being used like this
var _loc2 = new Color("_level1.shellContainer.INTERFACE.BALLOONS.p" + _loc3 + ".balloon_mc");
_loc2.setRGB(_loc4);
I want to apply a glow filter to _level1.shellContainer.INTERFACE.BALLOONS.pLOC3.balloon_mc but I don't know how because I cant access balloon_mc because it needs _loc3 after BALLOONS.p and I don't know how you could add loc3 to this. If someone could tell me howto add loc3 or howto add glowfilter without having to do that it would be great. I'm also using actionscript 2.
I'm pretty sure that's not the correct way to do this, but as you only posted one line of code, i can't help you on this issue.
However, since you seem to want to change the colors of an object with a glowfilter, you can just use it like this:
object.filters = new Array(new GlowFilter(0xFFFFFF,1, 6, 6, 9, BitmapFilterQuality.LOW, false, overlap));
The parameters are:
GlowFilter(color:uint = 0xFF0000, alpha:Number = 1.0, blurX:Number = 6.0,
blurY:Number = 6.0, strength:Number = 2, quality:int = 1, inner:Boolean = false,
knockout:Boolean = false)
alpha : Number
The alpha transparency value for the color.
blurX : Number
The amount of horizontal blur.
blurY : Number
The amount of vertical blur.
color : uint
The color of the glow.
inner : Boolean
Specifies whether the glow is an inner glow.
knockout : Boolean
Specifies whether the object has a knockout effect.
quality : int
The number of times to apply the filter.
strength : Number
The strength of the imprint or spread.
See : http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filters/GlowFilter.html
Try
new Color(_level1.shellContainer.INTERFACE.BALLOONS['p' + _loc3].balloon_mc);
In my highchart, at some point, I need to update min, max and tickInterval of a yAxis.
I tried 3 ways:
I tried the following code, but it says "object# has no menthod 'update'"
var extremes = chart.yAxis[i].getExtremes();
chart.yAxis[i].update({
min: extremes.dataMin * 1.1,
max: extremes.dataMax * 1.1,
tickInterval : SomeValue,
});
Also I tried chart.redraw as well... using the following code
chart.yAxis[i].min = extremes.dataMin * 1.1;
chart.yAxis[i].max = extremes.dataMax * 1.1;
chart.yAxis[i].tickInterval = SomeValue;
chart.redraw();
This time it does not show any error, but the chart does not refreshed as well.
This time,I tried to update the options and then to create a new highchart:
options.yAxis[i].min = extremes.dataMin * 1.1;
options.yAxis[i].max = extremes.dataMax * 1.1;
options.yAxis[i].tickInterval = SomeValue;
chart = new Highcharts.Chart(options);
It works this time, but I dont want to create a new highchart, I want to update the old one, because I am using it in one another method too.
Please let me know, how this can work, and also if I create new highchart using the 3rd way, then is there a way to get the latest 'chart' variable in another method?
Thank you
See this highcharts API:
setExtremes (Number min, Number max, [Boolean redraw], [Mixed animation])
Link: http://api.highcharts.com/highcharts#Axis.setExtremes()
They also have some jsfiddle examples there.
EDIT: to change the tickinterval try following:
chart.yAxis[0].options.tickInterval = markInterval;
Add this too after the above line:
chart.xAxis[0].isDirty = true;
you should use other object to trigger yAxis's update method.
exp:
var chart = new Highcharts(config);
var axes = chart.axes; // this is all Axis object
var xAxis = axes[0]; // by array's method get axis object
var yAxis = axes[1];
// now, object is ok, next trigger update method
yAxis.update(<your attribute config>);
highcharts versions by: "4.1.9"
You have only one option:
$(container).highcharts({
xAxis: {
max: 10 //you can set the maximum here
}
})
The maximum value can be defined only once. After that, any other changes have no effect to the chart.
chart.xAxis[0].options.max = 12; //this statement has no effect
Add below lines before setting chart.addSeries
chart.options.series = false;
chart = new Highcharts.Chart(chart.options);
chart.render();
i make a PieChart at run time, and i want to interpolate data change, but i have some difficult.
The Code is here:
//Pie Chart
pieChart.dataProvider = expenses;
var pieSeries:PieSeries = new PieSeries();
pieSeries.nameField = "position";
pieSeries.field = "value";
pieSeries.explodeRadius = 0.08;
pieChart.series = null;
pieChart.series.push(pieSeries);
I found two method, but i don't know how to use that >.<:
pieSeries.beginInterpolation
pieSeries.interpolate
1) First create a SeriesInterpolate class instance and customize it however you want.
2) You can set the showDataEffect style of your pieSeries object to the interpolate object that you just created.
Whalah.. whenever your data changes the interpolator will get triggered.
See the code snippet below..
I've also created an example application with source enabled.
goto: http://befreestudiosllc.com/demos/flex4/charting/seriesInterpolate/ and right-click to view source.
// Create an interpolator and customize its properties
var interpolateDataIn:SeriesInterpolate = new SeriesInterpolate();
interpolateDataIn.duration = 1000;
var pieSeries:PieSeries = new PieSeries();
pieSeries.setStyle("showDataEffect", interpolateDataIn); // apply interpolators to your series through show/hide dataEffects