Javascript 基于类别字段聚合的绘图-雅克西无序

Javascript 基于类别字段聚合的绘图-雅克西无序,javascript,angular,graph,plotly,plotly.js,Javascript,Angular,Graph,Plotly,Plotly.js,在此图中,将应用计数聚合,并且yAxis不排序 yAxis具有分类值(可以在聚合之前看到) 当yAxis中有数值时,此问题不存在 对于测试: 在上面的代码笔中,使用此代码 var score = ['Moe','Larry','Curly','Moe','Larry','Curly','Moe','Larry','Curly','Moe','Larry','Curly'] var subject = [1,6,2,8,2,9,4,5,1,5,2,8] 而不是 var subject

在此图中,将应用计数聚合,并且yAxis不排序

yAxis具有分类值(可以在聚合之前看到)

当yAxis中有数值时,此问题不存在

对于测试:

在上面的代码笔中,使用此代码

    var score = ['Moe','Larry','Curly','Moe','Larry','Curly','Moe','Larry','Curly','Moe','Larry','Curly']
var subject = [1,6,2,8,2,9,4,5,1,5,2,8]
而不是

var subject = ['Moe','Larry','Curly','Moe','Larry','Curly','Moe','Larry','Curly','Moe','Larry','Curly']
var score = [1,6,2,8,2,9,4,5,1,5,2,8]

上面的示例看起来可能有点奇怪,但它只是为了测试在stackoverflow上找到以下主题:,我认为错误可能出现在y轴上的布局类型中。是否设置为“类别”?如果是这样,它就不能获得Plotly的排序功能

下面是Plotly用无序数字显示的相同示例:

yaxis:{title:'Score',范围:[0,22],键入:“category”}
布局={title:'Plotly Aggregations
使用下拉菜单更改聚合,'xaxis:{title:'Subject'},yaxis:{title:'Score',范围:[0,22],键入:“category”},高度:600,宽度:900,…}
在stackoverflow上找到以下主题:,我认为y轴上的布局类型可能会出现错误。是否设置为“类别”?如果是这样,它就不能获得Plotly的排序功能

下面是Plotly用无序数字显示的相同示例:

yaxis:{title:'Score',范围:[0,22],键入:“category”}
布局={title:'Plotly Aggregations
使用下拉菜单更改聚合,'xaxis:{title:'Subject'},yaxis:{title:'Score',范围:[0,22],键入:“category”},高度:600,宽度:900,…}
是。在这个代码笔中,yAxis得到了数值。这意味着,在计数聚合之后,计数值是orderedtype(枚举的:“-”|“linear”|“log”|“date”|“category”),没有数字类型。代码中有布局结构吗?有。在这个代码笔中,yAxis得到了数值。这意味着,在计数聚合之后,计数值是orderedtype(枚举的:“-”|“linear”|“log”|“date”|“category”),没有数字类型。您的代码中有布局结构吗?
yaxis: {title: 'Score', range: [0,22], type:"category"}

layout = {  title: '<b>Plotly Aggregations</b><br>use dropdown to change aggregation',  xaxis: {title: 'Subject'},  yaxis: {title: 'Score', range: [0,22], type:"category"},  height: 600,  width: 900,...}