\n
The code I am using is this:
\n<cfchart \n format="#chart_format#"\n chartWidth="#width#"\n chartHeight="#getCustomersBySalesReps.RecordCount * 35#"\n show3D = "#show3D#"\n showlegend="no"\n >\n <cfchartseries \n query = "getCustomersBySalesReps" \n type = "horizontalbar" \n itemColumn = "name" \n valueColumn = "value"\n dataLabelStyle = "value"\n seriesLabel = "name"\n >\n </cfchartseries>\n </cfchart>\n
\n","author":{"@type":"Person","name":"Adrian Ciocălău"},"upvoteCount":2,"answerCount":1,"acceptedAnswer":null}}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: 284
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