I need to remove the category field from the bar chart.Please suggest me how can i do this.
if i make labels inside false it is coming in left side.i need to remove it completely from the bar.
also check this jsFiddle
https://jsfiddle.net/ArunKumarUmma/21wm5hf5/6/
JavaScript
x
127
127
1
var chart = AmCharts.makeChart( "chartdiv", {
2
"type": "serial",
3
"theme": "light",
4
"dataProvider": [ {
5
"Index":"2.45",
6
"amt":"148,773.88",
7
"amt1":"60,794.55",
8
"color":"#ba5bbb",
9
"color1":"#428DB6",
10
"name":"Name1",
11
"value":"148773.88",
12
"value1":"60794.55"
13
14
}, {
15
"Index":"2.45",
16
"amt":"148,773.88",
17
"amt1":"60,794.55",
18
"color":"#ba5bbb",
19
"color1":"#428DB6",
20
"name":"Name2",
21
"value":"148773.88",
22
"value1":"60794.55"
23
}, {
24
"Index":"2.45",
25
"amt":"148,773.88",
26
"amt1":"60,794.55",
27
"color":"#ba5bbb",
28
"color1":"#428DB6",
29
"name":"Name3",
30
"value":"148773.88",
31
"value1":"60794.55"
32
}, {
33
"Index":"2.45",
34
"amt":"148,773.88",
35
"amt1":"60,794.55",
36
"color":"#ba5bbb",
37
"color1":"#428DB6",
38
"name":"Name4",
39
"value":"148773.88",
40
"value1":"60794.55"
41
}, {
42
"Index":"2.45",
43
"amt":"148,773.88",
44
"amt1":"60,794.55",
45
"color":"#ba5bbb",
46
"color1":"#428DB6",
47
"name":"Name5",
48
"value":"148773.88",
49
"value1":"60794.55"
50
}],
51
"type": "serial",
52
"theme": "light",
53
"categoryField": "name",
54
"rotate": true,
55
"startDuration": 1,
56
"startEffect":"easeOutSine",
57
"columnSpacing": 0,
58
"autoMargins": false,
59
"marginBottom": 0,
60
"pullOutRadius": 0,
61
"categoryAxis": {
62
"inside": true,
63
"gridPosition": "start",
64
"gridAlpha": 0,
65
"axisAlpha": 0,
66
"tickPosition": "start",
67
"tickLength": 0,
68
"position": "left"
69
},
70
"trendLines": [],
71
"graphs": [
72
{
73
"balloonText": " [[name]]: $[[amt]]<br> Index: [[Index]]",
74
"fillAlphas": 0.8,
75
"fillColorsField": "color1",
76
"id": "AmGraph-12",
77
"lineAlpha": 0.2,
78
"title": "amt",
79
"type": "column",
80
"valueField": "value",
81
"showHandOnHover":true,
82
"labelText": "[[Index]]",
83
"labelPosition": "right",
84
85
"fixedColumnWidth": 15
86
},
87
{
88
"balloonText": " [[name]]: $[[amt1]]",
89
"fillAlphas": 0.8,
90
"fillColorsField": "color",
91
"id": "AmGraph-22",
92
"lineAlpha": 0.2,
93
"title": "amt",
94
"type": "column",
95
"valueField": "value1",
96
"showHandOnHover":true,
97
"fixedColumnWidth": 15
98
}
99
],
100
"guides": [],
101
"valueAxes": [
102
{
103
"id": "ValueAxis-1",
104
"axisAlpha": 0,
105
"gridAlpha": 0,
106
"labelsEnabled": false,
107
"minimum":0
108
}
109
],
110
"allLabels": [],
111
"balloon": {
112
"fillColor": "#000000",
113
"color": "#ffffff",
114
"fillAlpha": 1.0,
115
"offsetX": 0,
116
"offsetY": 0,
117
"horizontalPadding":0,
118
"maxWidth":100
119
},
120
"titles": [],
121
"export": {
122
"enabled": true
123
}
124
125
126
} );
127
Please check the image what i required exactly
Advertisement
Answer
You can hide category axis labels by setting labelsEnabled
to false in the categoryAxis
object.
To remove the value label on the right side of the bar, remove the labelText
definition in your graph object.