Reputation: 361
I am using CFCHART to display a basic horizontal bar chart, but the result is showing only every second label on the Y-AXIS as shown in the below screenshot. I noticed this is happening only on queries with many lines and it doesn't help if I increase the height of the bars. Even when they are huge, the labels on the Y-AXIS are 1, 3, 5, etc. Every second row.
The code I am using is this:
<cfchart
format="#chart_format#"
chartWidth="#width#"
chartHeight="#getCustomersBySalesReps.RecordCount * 35#"
show3D = "#show3D#"
showlegend="no"
>
<cfchartseries
query = "getCustomersBySalesReps"
type = "horizontalbar"
itemColumn = "name"
valueColumn = "value"
dataLabelStyle = "value"
seriesLabel = "name"
>
</cfchartseries>
</cfchart>
Upvotes: 2
Views: 283
Reputation: 361
This is how I solved the problem:
<cfset xAxis = {"max-items":"#getCustomersBySalesReps.RecordCount#","items-overlap":true}>
<cfchart
format="#chart_format#"
chartWidth="#width#"
chartHeight="#getCustomersBySalesReps.RecordCount * 35#"
show3D = "#show3D#"
showlegend="no"
xAxis = '#xAxis#'
>
<cfchartseries
query = "getCustomersBySalesReps"
type = "horizontalbar"
itemColumn = "name"
valueColumn = "value"
dataLabelStyle = "value"
seriesLabel = "name"
>
</cfchartseries>
</cfchart>
Upvotes: 1