The Wayback Machine - https://web.archive.org/web/20201102112114/https://github.com/AAChartModel/AAChartCore/issues/53
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

扇形图数据超过11个显示不全怎么搞 #53

Open
shunanlove opened this issue Jul 23, 2020 · 12 comments
Open

扇形图数据超过11个显示不全怎么搞 #53

shunanlove opened this issue Jul 23, 2020 · 12 comments

Comments

@shunanlove
Copy link

@shunanlove shunanlove commented Jul 23, 2020

@AAChartModel 麻烦帮忙看一下,我从IOS那面看了一下OC的Issues,我使用了allowOverlap这个属性还是不行。
c
a

@shunanlove
Copy link
Author

@shunanlove shunanlove commented Jul 23, 2020

目前数据21条

@AAChartModel
Copy link
Owner

@AAChartModel AAChartModel commented Jul 23, 2020

奇怪了, 你看这个网页 http://salarycalculator.sinaapp.com/

@AAChartModel
Copy link
Owner

@AAChartModel AAChartModel commented Jul 23, 2020

image

数据很多的时候,似乎也没啥毛病

@AAChartModel
Copy link
Owner

@AAChartModel AAChartModel commented Jul 23, 2020

你看他的 pie 配置代码

function renderOrgPieChart(data, selector) {
    var $target = $(selector);
    $target.highcharts({
        credits: {
            enabled: false
        },
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: true
        },
        title: {
            text: '鍗曚綅鎴愭湰鍘诲悜'+' (鍏憋骏'+(parseFloat(data.origin_salary)+parseFloat(data.org_allpay))+')'
        },
        tooltip: {
            pointFormat: '锟point.y}<br />{series.name}: <b>{point.percentage:.1f}%</b>'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    format: '<b>{point.name}</b>: {point.percentage:.1f} %',
                    style: {
                        color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black'
                    }
                },
                size: (($(window).width()>=480) ? 180 : 100)
            }
        },
        series: [{
            type: 'pie',
            name: '姣斾緥',
            data: [
                ['涓汉绋庡悗鏈堣柂', parseFloat(data.final_salary)],
                ['涓汉鍏昏€佷繚闄╅噾', parseFloat(data.personal_yanglao)],
                ['涓汉鍖荤枟淇濋櫓閲�', parseFloat(data.personal_yiliao)],
                ['涓汉澶变笟淇濋櫓閲�', parseFloat(data.personal_shiye)],
                ['涓汉鍩烘湰浣忔埧鍏Н閲�', parseFloat(data.personal_gjj)],
                ['涓汉琛ュ厖浣忔埧鍏Н閲�', parseFloat(data.personal_exgjj)],
                ['涓汉鎵€寰楃◣', parseFloat(data.tax)],
                ['浼佷笟鍏昏€佷繚闄╅噾', parseFloat(data.org_yanglao)],
                ['浼佷笟鍖荤枟淇濋櫓閲�', parseFloat(data.org_yiliao)],
                ['浼佷笟澶变笟淇濋櫓閲�', parseFloat(data.org_shiye)],
                ['浼佷笟宸ヤ激淇濋櫓閲�', parseFloat(data.org_gongshang)],
                ['浼佷笟鐢熻偛淇濋櫓閲�', parseFloat(data.org_shengyu)],
                ['浼佷笟鍩烘湰浣忔埧鍏Н閲�', parseFloat(data.org_gjj)],
                ['浼佷笟琛ュ厖浣忔埧鍏Н閲�', parseFloat(data.org_exgjj)]

            ]
        }]
    });
}

没太看出来有什么问题

@shunanlove
Copy link
Author

@shunanlove shunanlove commented Jul 23, 2020

难道是手机屏幕宽度太窄的问题么,他是PC 基本宽度够用。

@shunanlove
Copy link
Author

@shunanlove shunanlove commented Jul 23, 2020

试了一下应该是屏幕宽度问题 我横屏后能显示了。。。。你看能不能兼容一下

@shunanlove
Copy link
Author

@shunanlove shunanlove commented Jul 23, 2020

@AAChartModel
Copy link
Owner

@AAChartModel AAChartModel commented Jul 23, 2020

那就说明你的饼图尺寸太大了,没有释放足够的空间用于显示 DataLabels

@shunanlove
Copy link
Author

@shunanlove shunanlove commented Jul 23, 2020

size

那就说明你的饼图尺寸太大了,没有释放足够的空间用于显示 DataLabels

new AAPie()
.name("执行")
// .innerSize("20%")
.size(10f)
.dataLabels(new AADataLabels()
.allowOverlap(true)
.enabled(true)
.useHTML(true)
.distance(1f)
// .format("{point.name}:
{point.percentage:.1f} %")
)
.data(objects)
设置成size设置成10F也不行

@AAChartModel
Copy link
Owner

@AAChartModel AAChartModel commented Jul 23, 2020

这就有点蛋疼了,可能是非要达到一定的宽高比才行

@shunanlove
Copy link
Author

@shunanlove shunanlove commented Jul 23, 2020

@AAChartModel this.category “undefined” 到Java这面空指针了。。 我少传什么属性了么?
aa
bb

@shunanlove
Copy link
Author

@shunanlove shunanlove commented Jul 23, 2020

我看了一下 扇形图不用传这个数据吧,我修改了一下:
eventMessageModel.category = messageBody.get("category") != null ? messageBody.get("category").toString() : "";

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.