小编nee*_*hah的帖子

使用Javascript/Jquery添加点

我已经在我的项目中实现了一个图表并且运行良好.现在我想在一个特定的动态上添加一个点X-Axis onclick.

这是迄今为止我尝试过的小提琴. 小提琴演示

和代码

plotOptions: {
  series: {
    cursor: 'ns-resize',
    point: {
        events: {
            drag: function(e) {},
            drop: function() {
                var y_val = Highcharts.numberFormat(this.y, 2);
                var x_val = Highcharts.numberFormat(this.x, 2);
                updater(y_val, x_val);
                console.log(options.series[1].data);
            }
        }
    },
Run Code Online (Sandbox Code Playgroud)

现在有一种方法可以X-axis在点击上添加一个点.例如,如果我们点击之间10%-20%,那么15%应该在X轴上添加一个点.它也应该附在表格中.

感谢帮助

html javascript jquery highcharts

6
推荐指数
1
解决办法
1556
查看次数

是否可以使用jqplot制作此图表?

是否可以使用jqplot制作图形,如下所示?最接近可能的图表是stacked使用该着色以及点标签是一个问题.

预期产出

这个jsfiddle包含我努力制作这个条形图以及它的图例和点标签.因此可以使它看起来像图像.

var barchart = $.jqplot('chart1', [s1, s2, s3], {
    animate: true,
    grid: {
        background: 'white',
        drawBorder:false,
        shadow: false
    },

    seriesColors: ['#73C6E8', '#F28570', '#727272'],
    seriesDefaults: {
        renderer: $.jqplot.BarRenderer,
        rendererOptions: {
            barPadding: 20,
            barWidth: 25,
            barMargin:10,
            fillToZero: true
        },
        pointLabels: { show: true }
    },
    series: [
        { label: 'USA' },
        { label: 'India' },
        { label: 'South Africa' }
    ],
    legend: {
        show: true,
        placement: 'outsideGrid',
        location:'se',
        background:'white',
        border: 'white',
        fontFamily: 'Gotham Medium',
        fontSize:'12px',
        renderer: $.jqplot.EnhancedLegendRenderer …
Run Code Online (Sandbox Code Playgroud)

javascript css jquery jqplot

5
推荐指数
1
解决办法
415
查看次数

使用实体框架动态选择表

我有一个不同实体的属性名称,如汽车、人等。根据Id我想要的名称。但我想用一个方法来完成它,该方法接受实体名称并根据该名称给出输出。像这样的东西:

public string GetEntityByName(int id,string entityName)
    {
        using (var context = new MyContext())
        {
            return context[entityName].Find(id).Name;
        }
    }
Run Code Online (Sandbox Code Playgroud)

c# entity-framework

5
推荐指数
1
解决办法
2140
查看次数

Javascript 重定向在应用程序和 android 浏览器中的 Facebook 上不起作用?

JavaScript 重定向已停止在应用程序和浏览器中的最新版本的 facebook 上运行。尝试了 window.location.replace({url})很多不同的方法,但没有效果。包括:

  • 窗口打开方法
  • 使用目标方法打开 Window
  • 使用 window.location.href 进行评估
  • 使用 window.location.href 设置超时
  • 使用 window.onload 设置超时
  • Window.location 方法(设置当前窗口的新位置。)
  • Window.location.assign 方法(为当前窗口分配新的 URL。)
  • Window.location.replace 方法(用新窗口替换当前窗口的位置。)
  • Self.location方法(设置当前窗口本身的位置。)
  • Top.location 方法(设置当前窗口最顶层窗口的位置。)
  • 文档.location.href
  • 客户端点击触发器
  • 元刷新方法

关于它为什么不起作用的任何建议?

javascript redirect android facebook facebook-browser

5
推荐指数
0
解决办法
432
查看次数

在剃刀视图中使用内部类

我有一个内部类Web.Properties作为设置类Settings.settings.现在我想在mvc 4的剃刀视图(.cshtml文件)中使用其Settings类的属性

以下代码是设置文件(自动生成)

[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class UIMessagesSettings : global::System.Configuration.ApplicationSettingsBase {

    private static UIMessagesSettings defaultInstance = ((UIMessagesSettings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new UIMessagesSettings())));

    public static UIMessagesSettings Default {
        get {
            return defaultInstance;
        }
    }

    [global::System.Configuration.ApplicationScopedSettingAttribute()]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Configuration.DefaultSettingValueAttribute("An error occured while loading grid data.")]
    public string GridErrorMsg {
        get {
            return ((string)(this["GridErrorMsg"]));
        }
    }
  }
}
Run Code Online (Sandbox Code Playgroud)

我想在剃刀视图(.cshtml)中使用GridErrorMsg属性我尝试使用以下代码

@Properties.UIMessagesSettings.Default.GetType()
Run Code Online (Sandbox Code Playgroud)

但它说无法访问UIMessagesSettings,因为它是一个内部类.这个问题的解决方案是什么?

c# razor asp.net-mvc-4

4
推荐指数
1
解决办法
1369
查看次数