how to hide or remove extjs line chart axes (xaxis or yaxis) ticks - extjs4

I have requirement to hide the x axis (ticks and labels) .Anybody knows please tell me how to hide the ticks,I am able to hide the labels,but not the ticks,Basically my chart x axis will keep grow(more than 150 steps(ticks) with in 20 minutes),If i look at steps(ticks) alone (label hidden)in xaxis it so weird to see....
so please anybody have an idea to remove this ticks or steps
Thanks in Advance

We have "dashSize" config in Axis class:
http://docs.sencha.com/ext-js/4-0/#!/api/Ext.chart.axis.Axis-cfg-dashSize
You have to set it to 0 like this:
axes: {
...
dashSize: 0
...
}

If anyone else is looking for this for ExtJS 5, it's now
axes: [{
type: 'numeric',
...
}, {
type: 'category',
style: { majorTickSize : 0},
...
}]

Related

Creating shape or marks in custom indicator, (tradingview charting library (pinejs))

is there any way to create shape or create marks on chart in custom indicator using tradingview charting library. I am using this way to create custom indicators. Thanks in advance.
Yes you can. Here is the guide.
For the callouts/Markers on chart you can follow this guide in the JS API.
https://github.com/tradingview/charting_library/wiki/JS-Api#gettimescalemarkssymbolinfo-from-to-ondatacallback-resolution
For getmarks you can do this
getMarks: (symbolInfo, startDate, endDate, onDataCallback, resolution) => {
var Arr = [
{
id: 1,
time: 1551448800000 / 1000,
color: 'blue',
text: 'Hello world',
label: 'B',
labelFontColor: 'yellow',
minSize: 20
},
]
onDataCallback(Arr);
console.log("=====getMarks running");
},
It will plot the marks above the bars as shown in the below image.
For Timescalemarks.
getTimescaleMarks: (symbolInfo,startDate,endDate,onDataCallback,resolution) => {
onDataCallback([
{
id: 1,
time: / 1000,
color: 'Turquoise',
label: 'The test you want to show on marker',
minSize: 20,
tooltip:[
"Information you want to print",
]
},
]);
})
The Time scale marks will look like this. And they will be plotted below the bars.
And for the shapes like circles and arrows you can follow this documentation. And use the createMultipointShape(points, options) methos to plot your shapes.
https://github.com/tradingview/charting_library/wiki/Chart-Methods#createmultipointshapepoints-options

dygraphs smooth lines with drawPoints

I used this exmaple http://dygraphs.com/tests/smooth-plots.html to draw smooth lines. When I anable the smoothing by plotter: smoothPlotter small dots at data points disappear. I have set drawPoints: true. Dot is displayed when mouse is on the curve.
How can I enable small dots at data points ( http://dygraphs.com/options.html#drawPoints ) and still use smoothing?
I have not found a way to enable pointdrawing. But you can make a second series with the same data and draw only the points, not the lines. Like so:
new Dygraph(document.getElementById('graph'),
functionData,
{
series: {
Straight: {
color: 'red',
strokeWidth: 0,
drawPoints: true,
pointSize: 7
},
Smoothed: {
plotter: smoothPlotter,
color: 'red',
strokeWidth: 2
}
},
});
http://jsfiddle.net/wLxs4ju1/

AmChart legend in one line

I'm trying to get AmChart chart legends into one line, but without luck. Legends are separated (one for line).
Actual settings for from documentation http://docs.amcharts.com/3/javascriptcharts/AmLegend is
following.
"legend": {
"equalWidths": false,
//"periodValueText": "total: [[value.sum]]",
"position": "bottom",
"valueAlign": "left",
"labelWidth": 100,
"valueWidth": 200,
//"width": 100,
"align": "center"
},
I Would like to ask how to get all chart legends into one line?
Many Thanks for any advice.
you can try legend{
"maxColumns": 1,
}
I think it auto resize follows width of div.
Btw, You can change "valueWidth" lower.
Try reducing "labelWidth" and "valueWidth" to fit just the content
Try setting equalWidths = false and valueWidth = 0, like this:
"legend": {
"equalWidths": false,
"valueWidth": 0
}

Dojo charting: Can i change the color of the line based on the value?

I have a working chart with Dojo 1.8.
chart1 = new dojox.charting.Chart2D("chart1");
chart1.addPlot("default", {type: "Lines", ...
chart1.addSeries("Series A", [{ x: 1, y: 2.3, tooltip: "Value 1"}, ...
My data from the series gets displayed correctly as line and the whole line (series) gets the color 'Green'.
I know how to change the color for the whole series, but would it be possible that the line changes its color based on the data values? Lets assume the x-axis is a time axis and I need the line (series) to be green for until today, and then red for the future values.
Would this be possible and how ?
(I am using markers for the values. If these could change based on the value it would be enough)
I found something something like this in the documentation:
chart.addSeries("Series A", [
{y: 4, color: "red"},
{y: 2, color: "green"},
{y: 1, color: "blue"},
{y: 1, text: "Other", **color: "white", fontColor: "red"**}
]);
But it only works for PIE-charts and not for LINES-charts.
Thank you in advance.
You could try this http://jsfiddle.net/jUS54/
Use styleFunc in the addPlot method for change the markers colors:
var chart1 = new Chart("simplechart");
chart1.addPlot("default", {type: Lines, markers:true, styleFunc: function(item {
if(item <= 2){
return { fill : "red" };
}else if(item > 3){
return { fill: "green" };
}
return {};
}});
You can change the color by adding 'fill' to your chart data. Basically, loop through your input data deciding what to set your fill too while constructing the JSON for chartData.
var chartData = [{y: 10000,fill: "red"},{y:9200,fill: "yellow"},{y:11811,fill: "green"},{y:12000,fill: "blue"},{y:7662,fill: "blue"},{y:13887,fill: "black"},{y:14200,fill: "gray"},{y:12222,fill: "purple"},{y:12000,fill: "green"},{y:10009,fill: "purple"},{y:11288,fill: "green"},{y:12099,fill: "blue"}];
http://jsfiddle.net/goinoff/QnNk2/1/

Sencha Touch chart - How to add label/value in line chart

I am using Sencha Touch charts 1.0.0 for my project. I would like to add values on each point in my line chart (as in image). I tried the same approach in this question for column chart, but it didn't work out.
I had the same problem with you. But i find a solution instead for that. You can add marker at each node of line and when you click on marker a popup will show detail information as you want. This's my code may help you :
-Add marker in cofig of series :
type: 'line',
title: 'Clickeds : ' + total[4] + ' ( ' + Math.round(arrInfo[4]) + '% )',
highlightCfg: { scale : 0.7 },
xField: 'Date', yField: 'Clks',
style : {
stroke: 'rgb(50, 185, 150)',
miterLimit : 3,
lineCap: 'miter',
lineWidth: 2
}
,
marker:{
type: 'image',
src: 'resources/images/square.png',
width: 24,
height: 24,
x: -12,
y: -12,
scale: 0.5,
fx: {
duration: 200
}
}
Handle event when you click on node, you add listeners to config of chart : `listeners: {
itemtap: function( series, item, event, eOpts ){
//handle your code here.
}`
Regards,
(Sorry for bad english.)