我正在使用Dan Grossman的 Twitter Bootstrap 日期范围选择器.
初始化时,可以设置startDate和endDate等预定义值.是否可以稍后以类似的方式手动更新值?
我想要做的是用我保存的过滤器"加载"日期范围选择器,其中包括开始和结束日期(不是通过定义预定义的范围).只是通过jQuery更新日期范围选择器的字段将不会更新日历的实际选择.
我想在初始化日期范围选择器时我应该这样做:
var reportrange = $('#reportrange').daterangepicker(),
DateRangePicker = reportrange.data('daterangepicker');
Run Code Online (Sandbox Code Playgroud)
但是,如何使用DateRangePicker手动更新日期范围选择器和日历以及新选择的日期?
如何从amchart条形图中删除"js charts by amcharts"文本.有没有办法使用图表配置来做到这一点?请查看小提琴中的文字.
我想禁用/隐藏所有在x轴上的国家/地区标签,这是怎么可能的。
https://codepen.io/team/amcharts/pen/BrXwQL
chart.data = data;
// Create axes
var categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis());
categoryAxis.dataFields.category = "country";
categoryAxis.renderer.grid.template.disabled = true;
var valueAxis = chart.yAxes.push(new am4charts.ValueAxis());
valueAxis.title.text = "Units sold (M)";
valueAxis.min = 0;
valueAxis.renderer.baseGrid.disabled = true;
valueAxis.renderer.grid.template.strokeOpacity = 0.07;
// Create series
var series = chart.series.push(new am4charts.ColumnSeries());
series.dataFields.valueY = "units";
series.dataFields.categoryX = "country";
series.tooltip.pointerOrientation = "vertical";
Run Code Online (Sandbox Code Playgroud) 我已经查看了 amcharts 版本 4 ( https://www.amcharts.com/javascript-charts/ )的文档,但似乎无法找到如何将 y 轴格式化为货币。有关于以其他方式格式化 y 轴的文档,但货币似乎不是其中之一。有谁知道如何或从哪里开始?
到目前为止,我有上面的图表,只需要知道如何或在哪里将 y 轴格式化为货币。当您将鼠标悬停在格式化为货币的行上时,我目前有标签,因为这相当简单。这是我创建轴的函数:
function createAxisAndSeries(field, name, opposite) {
const valueAxis = chart.yAxes.push(new am4charts.ValueAxis());
const series = chart.series.push(new am4charts.LineSeries());
series.dataFields.valueY = field;
series.dataFields.dateX = 'date';
series.strokeWidth = 2;
series.yAxis = valueAxis;
series.name = name;
series.tooltipText = '{name}: [bold]${valueY}[/]';
series.tensionX = 0.8;
const interfaceColors = new am4core.InterfaceColorSet();
valueAxis.renderer.line.strokeOpacity = 1;
valueAxis.renderer.line.strokeWidth = 2;
valueAxis.renderer.line.stroke = series.stroke;
valueAxis.renderer.labels.template.fill = series.stroke;
valueAxis.renderer.opposite = opposite;
valueAxis.renderer.grid.template.disabled = true;
}
Run Code Online (Sandbox Code Playgroud) 我想知道在 AmCharts 中生成 amchart 图时是否有设置默认缩放的方法。
这是代码:
AmCharts.makeChart("chartdiv", {
type: "serial",
mouseWheelZoomEnabled: true,
fontFamily: "Montserrat",
path: "lib/amcharts/",
theme: "light",
fontSize: 12,
categoryField: "category",
precision: 0,
decimalSeparator: ",",
thousandsSeparator: ".",
plotAreaFillAlphas: 0.11,
plotAreaFillColors: "#61a1e6",
zoomOutButtonColor: "#D6E7F9",
sequencedAnimation: true,
startDuration: 1,
startEffect: "easeOutSine",
balloonText: "[[title]] [[category]]:[[value]]",
urlTarget: "#drill",
categoryAxis: {
autoRotateAngle: 0,
autoWrap: false,
gridPosition: "start",
axisAlpha: 0.16,
color: "#054bff",
gridAlpha: 0,
title: ""
},
chartScrollbar: {
"enabled": true
},
trendLines: [],
graphs: [
[LEGEND]
],
guides: [],
valueAxes: [{
[STACKED]
id: "ValueAxis-1", …Run Code Online (Sandbox Code Playgroud) 我有一个使用 amCharts 创建函数图的小任务。
问题是我需要启用光标,但也需要禁用缩放,因此我可以将图形调整为背景图像。
文档说使用 禁用缩放chart.zoomEnabled = false;,但它似乎不起作用,我不知道我会遗漏什么。
谢谢!
<style>
.graphContainer {
width: 500px;
height: 500px;
}
</style>
<script src="node_modules/ng"></script>
<script> let targetGroup =2; </script>
<script src="https://cdn.amcharts.com/lib/4/core.js"></script>
<script src="https://cdn.amcharts.com/lib/4/charts.js"></script>
<script src="https://cdn.amcharts.com/lib/4/plugins/forceDirected.js"></script>
<script src="https://cdn.amcharts.com/lib/4/plugins/piechart.js"></script>
<script src="https://cdn.amcharts.com/lib/4/themes/animated.js"></script>
<div class = "graphContainer" id="divElasticidad"></div>
<script type="text/javascript">
let sensor = { "value": 85 };
let mostrarComoPorcentajes = true;
</script>
<script type="text/javascript">
am4core.ready(function() {
// Themes begin
am4core.useTheme(am4themes_animated);
// Themes end
// Check if use percent or full value
let ejeX = "X";
let …Run Code Online (Sandbox Code Playgroud)