首页 \ 问答 \ 从Javascript更改Step值(Changing the Step value from Javascript)

从Javascript更改Step值(Changing the Step value from Javascript)

我在asp.net中有以下Kendo.Chart,我需要在刷新图表数据时更改Step值。

例如

。步骤(8)

。步骤(0)

我怎样才能做到这一点?

@(Html.Kendo().Chart<GenericDateTimeValueDataPoint>()
                              .Name("trendchart_" + location.LocationId)
                              .Legend(legend => legend.Visible(false))
                              .ChartArea(chartArea => chartArea.Background("transparent")
                                  .Height(276))
                              .AutoBind(false)
                              .DataSource(ds => ds.Read(read => read.Action("ProfileTrend", "Chart")
                                  .Data(@<text>function (){ var selectedTimespan = $('#duration option:selected').val(); var startDateTime = $('#startDateTimePicker').val(); var endDateTime = $('#endDateTimePicker').val() ; return { locationGuid: '@location.LocationId', timespan: selectedTimespan, startDateTime: startDateTime, endDateTime: endDateTime, timeZoneOffset: window.currentTimeZoneOffsetInHours }}</text>))
                                  .Events(ev => ev.RequestStart("viewModel.utilisationDataRequestStarted")
                                      .RequestEnd("uViewModel.utilisationDataLoaded")))
                              .SeriesDefaults(series => series.Column().Overlay(ChartBarSeriesOverlay.None))
                              .Series(series => series.Column(model => model.CollectedValue, categoryExpression: model => model.DateTimeFormattedString)
                                  .Gap(0.3)
                                  .Name("Valve Open")
                                  .Color(Lookups.GetColourAsHex(Colours.SilverGrey)))
                              .CategoryAxis(axis => axis.MajorGridLines(lines => lines.Visible(false))
                                  .Labels(labels => labels.Format("{0:d}").Step(8))
                                  .Categories()
                                  .Title(title => title.Text(DisplayText.Get("Time"))))
                              .ValueAxis(axis => axis.Numeric().Labels(labels => labels.Format("{0}%")).Line(line => line.Visible(true)).Min(0).Max(100).Title(title => title.Text(DisplayText.Get("Utilisation")))).Tooltip(tooltip => tooltip.Visible(true).Template("#=dataItem.DateTimeFormattedString#<br />#= kendo.format('{0:N2}',value) #%")))

I have the following Kendo.Chart in asp.net, and I need to change the Step value when the chart data is refreshed.

e.g.

.Step(8)

to

.Step(0)

How can I do this?

@(Html.Kendo().Chart<GenericDateTimeValueDataPoint>()
                              .Name("trendchart_" + location.LocationId)
                              .Legend(legend => legend.Visible(false))
                              .ChartArea(chartArea => chartArea.Background("transparent")
                                  .Height(276))
                              .AutoBind(false)
                              .DataSource(ds => ds.Read(read => read.Action("ProfileTrend", "Chart")
                                  .Data(@<text>function (){ var selectedTimespan = $('#duration option:selected').val(); var startDateTime = $('#startDateTimePicker').val(); var endDateTime = $('#endDateTimePicker').val() ; return { locationGuid: '@location.LocationId', timespan: selectedTimespan, startDateTime: startDateTime, endDateTime: endDateTime, timeZoneOffset: window.currentTimeZoneOffsetInHours }}</text>))
                                  .Events(ev => ev.RequestStart("viewModel.utilisationDataRequestStarted")
                                      .RequestEnd("uViewModel.utilisationDataLoaded")))
                              .SeriesDefaults(series => series.Column().Overlay(ChartBarSeriesOverlay.None))
                              .Series(series => series.Column(model => model.CollectedValue, categoryExpression: model => model.DateTimeFormattedString)
                                  .Gap(0.3)
                                  .Name("Valve Open")
                                  .Color(Lookups.GetColourAsHex(Colours.SilverGrey)))
                              .CategoryAxis(axis => axis.MajorGridLines(lines => lines.Visible(false))
                                  .Labels(labels => labels.Format("{0:d}").Step(8))
                                  .Categories()
                                  .Title(title => title.Text(DisplayText.Get("Time"))))
                              .ValueAxis(axis => axis.Numeric().Labels(labels => labels.Format("{0}%")).Line(line => line.Visible(true)).Min(0).Max(100).Title(title => title.Text(DisplayText.Get("Utilisation")))).Tooltip(tooltip => tooltip.Visible(true).Template("#=dataItem.DateTimeFormattedString#<br />#= kendo.format('{0:N2}',value) #%")))

原文:https://stackoverflow.com/questions/40263317
更新时间:2023-03-17 20:03

最满意答案

你无法分配这样的数组,例如

char foo[500];
foo = "this won't work";

你必须使用像strcpy这样的函数

strcpy(new_disk.current_file[0].name, "new name");

strncpy会更安全, std::string会更安全。


You can't assign arrays like that, e.g.

char foo[500];
foo = "this won't work";

You have to use a function like strcpy

strcpy(new_disk.current_file[0].name, "new name");

strncpy would be safer, and std::string would be even safer.

相关问答

更多
  • 简单地应用在标头声明的标准算法std::sort就足够了,因为如果所有布尔向量具有相同的大小,则为向量定义了operator < 。 这是一个例子 #include #include #include int main() { std::vector> v = { { 1, 1, 1 }, { 1, 0, 1 }, {0, 0, 0 }, { 1, 0 ...
  • 这是一个设计决定。 如果你有一个const容器,通常有理由认为你不希望任何人修改它包含的元素,这是它的一个固有部分。 如果你愿意,容器完全“拥有”这些元素“巩固了这种联系”。 这与历史悠久,更低级别的“容器”实现(即原始数组)相比更为放手。 正如你所说的, int const*和int * const之间有很大的区别。 但标准容器只是选择传递const 。 It's a design decision. If you have a const container, it usually stands to ...
  • C#有一个非常酷的功能,称为扩展方法 。 例如,设置一个类VectorExtensions,并将其放入: public static Vector2 YZ (this Vector3 v) { return new Vector2 (v.y, v.z); } 现在,您可以在项目中的任何地方拨打电话: Vector2 v2 = v3.YZ (); C# has a pretty cool feature called extension methods. Set up a class Vector ...
  • 最后请注意效率 根据您的预期输出结果,您可以对每个值进行迭代并对其进行计数(将TRUE值相加)该值比所有其他值要便宜多少次,并返回一个列表以将该值与计数“配对”: sapply(data[,2],function(x) { list(x, sum(x < data[,2])) }) 它以长格式提供: [,1] [,2] [,3] [1,] 477.99 457.99 556.31 [2,] 1 2 0 如果你只是想添加一列到你现有的数据集中,应该这 ...
  • V::at的返回类型是V::reference : auto b = std::bind(static_cast(&V::at), v); 不用说,这是令人厌恶的。 The return type of V::at is V::reference: auto b = std::bind(static_cast(&V::at), v); Needless to say ...
  • 我读到了Collections.unmodifiableList() ,但是如果我使我的Vector不可修改,那么它对我的类也将是只读的。 我想你误解了那种方法的作用。 实际上,它为现有列表创建了一个不可修改的包装器 ,使原始列表可以修改。 因此,处理您的要求的方法是做这样的事情1 : private Vector myVector = new Vector(); private List readOnly = Collections.Collections.unmodifiableLis ...
  • 你无法分配这样的数组,例如 char foo[500]; foo = "this won't work"; 你必须使用像strcpy这样的函数 strcpy(new_disk.current_file[0].name, "new name"); strncpy会更安全, std::string会更安全。 You can't assign arrays like that, e.g. char foo[500]; foo = "this won't work"; You have to use a fu ...
  • 向量在内部是指针,因此向量的指针有点矫枉过正。 当需要多态内容时,通常使用指针或智能指针的向量。 在C ++ 03中,插入更多向量或(擦除现有的)主矢量可能很昂贵,但C ++ 0x甚至可以解决其移动语义的问题。 最好在使用真实数据进行分析后切换到更合适的容器,而不是试图使其最初非常动态。 Vector is internally a pointer so pointer of vector is sort of overkill. Vector of pointers or smart pointers i ...
  • 使用get-in和assoc-in : (defn swap-in [vv p1 p2] (let [v1 (get-in vv p1) v2 (get-in vv p2) (-> vv (assoc-in p1 v2) (assoc-in p2 v1)))) 所以现在: (def my-vec [[1 2 3] [4 5 6] [7 8 9]]) (swap-in my-vec [0 2] [1 1]) => [[1 2 5] [4 3 6] ...
  • 向量提供随机访问; 你可以简单地重新分配元素: myV[5] = std::make_pair(42, true); *it = std::make_pair(35, false); Vectors give random access; you can simply reassign the element: myV[5] = std::make_pair(42, true); *it = std::make_pair(35, false);

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。