Tag: 条形图

在代码隐藏的DataTemplate中find一个WPF元素

我有一个数据模板 <Window.Resources> <DataTemplate x:Key="BarChartItemsTemplate"> <Border Width="385" Height="50"> <Grid> <Rectangle Name="rectangleBarChart" Fill="MediumOrchid" StrokeThickness="2" Height="40" Width="{Binding}" HorizontalAlignment="Right" VerticalAlignment="Bottom"> <Rectangle.LayoutTransform> <ScaleTransform ScaleX="4"/> </Rectangle.LayoutTransform> </Rectangle> <TextBlock Margin="14" FontWeight="Bold" HorizontalAlignment="Right" VerticalAlignment="Center" Text="{Binding}"> <TextBlock.LayoutTransform> <TransformGroup> <RotateTransform Angle="90"/> <ScaleTransform ScaleX="-1" ScaleY="1"/> </TransformGroup> </TextBlock.LayoutTransform> </TextBlock> </Grid> </Border> </DataTemplate> </Window.Resources> 我在表格上有一个button。 我需要从dataTemplate改变比例(scaleTransform)矩形。 我该如何访问上述button的Button_Click事件中的“rectangleBarChart”元素?

使用ggplot2在地图上绘制条形图?

我想使用ggplot2为地图上的每个位置生成一个barplot,就像xm根据基础graphics和一些包所做的那样: Let R fly: Visualizing Export Data using R 这与在情节中embedded微型情节有关。 目前,我能做的最好的事情就是在抖动点图上匹配点的大小。 require(ggplot2) require(maps) #Get world map info world_map <- map_data("world") #Creat a base plot p <- ggplot() + coord_fixed() #Add map to base plot base_world <- p + geom_polygon(data=world_map, aes(x=long, y=lat, group=group)) #Create example data geo_data <- data.frame(long=c(20,20,100,100,20,20,100,100), lat=c(0,0,0,0,0,0,0,0), value=c(10,30,40,50,20,20,100,100), Facet=rep(c("Facet_1", "Facet_2"), 4), colour=rep(c("colour_1", "colour_2"), each=4)) […]

D3js – 将垂直条形图更改为水平条形图

我有一个成对分组的垂直条形图。 我试图玩弄如何水平翻转它。 在我的情况下,关键字会出现在y轴上,而比例会出现在x轴上。 我尝试过切换各种x / yvariables,但这当然只是产生了时髦的结果。 我需要关注哪些代码区域,以便将其从竖线切换到横线? My JSFiddle: Full Code var xScale = d3.scale.ordinal() .domain(d3.range(dataset.length)) .rangeRoundBands([0, w], 0.05); // ternary operator to determine if global or local has a larger scale var yScale = d3.scale.linear() .domain([0, d3.max(dataset, function (d) { return (d.local > d.global) ? d.local : d.global; })]) .range([h, 0]); var xAxis = […]

如何使用pyplot.barh()显示每个栏上的栏的值?

我生成了一个条形图,如何显示每个条上的条形图的值? 当前情节: 我想要得到什么: 我的代码: import os import numpy as np import matplotlib.pyplot as plt x = [u'INFO', u'CUISINE', u'TYPE_OF_PLACE', u'DRINK', u'PLACE', u'MEAL_TIME', u'DISH', u'NEIGHBOURHOOD'] y = [160, 167, 137, 18, 120, 36, 155, 130] fig, ax = plt.subplots() width = 0.75 # the width of the bars ind = np.arange(len(y)) # the x locations for […]

将geom_text定位在闪避的barplot上

我试图让这个标题不言自明,但是数据优先: dtf <- structure(list(variable = structure(c(1L, 1L, 2L, 2L, 3L, 3L, 4L, 4L, 5L, 5L), .Label = c("vma", "vla", "ia", "fma", "fla"), class = "factor"), ustanova = structure(c(1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L, 1L, 2L), .Label = c("srednja škola", "fakultet"), class = "factor"), `(all)` = c(42.9542857142857, 38.7803203661327, 37.8996138996139, 33.7672811059908, 29.591439688716, 26.1890660592255, 27.9557692307692, 23.9426605504587, […]

多行轴标签嵌套分组variables

我希望两个不同的嵌套分组variables的级别出现在图下方的分隔线上,而不是图例中。 我现在所拥有的是这个代码: data <- read.table(text = "Group Category Value S1 A 73 S2 A 57 S1 B 7 S2 B 23 S1 C 51 S2 C 87", header = TRUE) ggplot(data = data, aes(x = Category, y = Value, fill = Group)) + geom_bar(position = 'dodge') + geom_text(aes(label = paste(Value, "%")), position = position_dodge(width = […]