我在ggplot2中整理了一个气泡图,并希望改变我的气泡轮廓(以符合工作的格式指南).我的问题是我使用颜色来组合变量,而我正在使用自定义调色板(再次,用于工作).理想情况下,我想在气泡上加上黑色边框.
这是我的数据框架:
mmur <- structure(list(Medgrowth = c(-1.02232983588915, 3.01155115511551,-0.220617729642996, 1.96506550218342, 0.943970767356888, 0.810810810810807,0.0166694449074782, 0.21064457239153, 0.0876731544801004, 0.132216835610393,0.370644922164558,0.23378141437756, 1.27810650887574, 0.42301184433164,0.394880174291941, 0.54216172568924, 1.32690882134916, 0.499722376457527,-0.108885017421599), Medunemp = c(4.430550475, 2.5060469975,4.1239796475, 2.0585977455, 3.846659243, 3.1792594425, 4.0033450105,6.0882984255, 3.091889808,3.7462810695, 2.4038147815, 3.0065393475,2.3331894185, 4.9482480125, 2.0955470885, 1.616694725, 1.873037069,3.060170157, 3.0131425595), Empsize = c(324.2,270.6, 962.1,149, 962.4, 421.1, 1197.8, 777.8, 552.8, 234.8, 421.1, 203.2,915.7, 396.1, 685.9, 904.5, 1366.9, 215.4, 440.5), Eduratio = c(0.1,0.2, 0.1, 0.2, 0.1, 0.2, 0.1, 0.1, 0.1, 0.3, 0.3, 0.2, 0.5, 0.2,0.3, 0.6, 0.4, 0.2, 0.1), Names = structure(c(3L, 12L, 11L, 7L,5L, 19L, 17L, …Run Code Online (Sandbox Code Playgroud) 我正在寻找一种方法来显示以下案例的Highcharts气泡图:
我想在X轴上显示项目名称("项目a","项目b")和y轴上的团队成员名称(例如"tom","bill","john").气泡旨在可视化每个团队成员在每个项目上花费的时间.
数据系列应该类似于['project a','tom',25.0],['project b','john',12.5] ......,但尝试这会导致"Highcharts Error#14:String value sent sent to series.data,expected Number"
是否有可能在x轴和y轴上使用字符串值而不是数字的Highcharts气泡/ 3d气泡图表,或者有没有办法实现类似的东西?
任何指导将不胜感激.
谢谢.
我有以下代码:
var chart = new Highcharts.Chart({
chart: {
type: 'bubble',
zoomType: 'xy',
renderTo: 'municipalgraph'
},
title: {
text: ''
},
yAxis: {
title: {
text: ''
}},
tooltip: {
formatter: function() {
return this.point.name + '<br/><b>' + this.x + '</b><br/><b>' + this.y + '</b>'
}},
series: [{
data: [67,78,75],[64,12,10],[30,77,82]]
}]
});
Run Code Online (Sandbox Code Playgroud)
我想为每个点添加一个名称,以便在工具提示中显示它.可能吗?
在我的nvd3气泡图中,每组点都有不同的符号,但图例全部为圆圈.代码在这里.我只碰到过这个
.showLegend(false)
Run Code Online (Sandbox Code Playgroud)
它可以隐藏或显示图例.我无法理解如何更改图例中的符号.
我试图在nvd3气泡图中绘制一条水平线(供参考).我试图在svg图表上添加一行
.append('line')
.attr({
x1: x(0),
y1: 10,
x2: x(3),
y2: 10
});
Run Code Online (Sandbox Code Playgroud)
但我没有成功.这是小提琴.请注意,y1和y2值是相同的(即10),因为我试图绘制一条水平线(y=10).
我正在尝试使用 npm 版本的 highcharts 绘制带有 highchart 的气泡图,但是出现错误 #17,我已经尝试导入 highcharts-more,但是没有用...
我有以下进口
import $ from "jquery";
import _ from "underscore";
import Logger from 'js-logger';
import Marionette from 'backbone.marionette';
import Highcharts from 'Highcharts';
import 'Highcharts/highcharts-more';
Run Code Online (Sandbox Code Playgroud)
气泡图的选项如下:
settings = {
chart: {
type: 'bubble',
plotBorderWidth: 1,
zoomType: 'xy'
},
legend: {
enabled: false
},
title: {
text: 'Sugar and fat intake per country'
},
subtitle: {
text: 'Source: <a href="http://www.euromonitor.com/">Euromonitor</a> and <a href="https://data.oecd.org/">OECD</a>'
},
xAxis: {
gridLineWidth: 1,
title: {
text: 'Daily fat intake' …Run Code Online (Sandbox Code Playgroud) 我想在R中创建这样的图表:http://bl.ocks.org/mbostock/4063269
所以只是一个没有轴的气泡图,气泡可以随机分散,只有size参数.
我很感兴趣在R中这样做,我熟悉的选项需要提供x,y和size变量.
我正在使用 python 使用plotly 制作气泡图。我想可视化词频。所以我制作了两列,其中有 5 个气泡,我想在每个气泡内写下这个词。我的代码是:
trace0 = go.Scatter(
x=[1, 1, 1, 1, 1],
y=[1, 2, 3, 4, 5],
mode='markers',
text=['plant', 'use', 'student', 'show', 'water'], #words I want to show
textposition='top center',
marker=dict(
size=norm,
color=['rgb(255, 144, 14)','rgb(255, 144, 14)','rgb(255, 144, 14)', 'rgb(255, 144, 14)',
'rgb(255, 144, 14)'],
)
)
trace1 = go.Scatter(
x=[2, 2, 2, 2, 2],
y=[1, 2, 3, 4, 5],
mode='markers',
text=['use', 'water', 'diagram', 'show', 'plant'], #words I want to show
textposition='top center',
marker=dict(
size=norm,
color=['rgb(93, 164, 214)','rgb(93, …Run Code Online (Sandbox Code Playgroud) 我们能用高压做泡沫图吗?如果是的话我需要帮助,因为我这样做,但它不起作用:
$(function () {
$('#container').highcharts('StockChart',{
chart: {
type: 'bubble',
},
title: {
text: 'Highcharts Bubbles'
},
series: [{
data: [[Date.UTC(1970, 9, 27),97,36,79],
[Date.UTC(1970, 10, 10),94,74,60],
[Date.UTC(1970, 10, 18),68,76,58],
]
}]
});
});
Run Code Online (Sandbox Code Playgroud)
谢谢