小编Phi*_*nan的帖子

带高位图的knockoutJS动态图

所以,过去一周我一直在玩高排行榜和 KO。高图表的语法非常简单且易于阅读。

我来自 Java,我对 JS 还很陌生,所以我不确定如何真正使用范围​​。

无论如何使用或结合淘汰赛与高图表来轻松制作动态图表?我可以简单地将它们放在同一个 JS 文件中吗?

高图表代码看起来如此简单,必须有一个简单的解决方案!预先感谢您的输入/帮助!

这是我的高图表代码:

$(function() {
    var chart;
    //alert(users);
    $(document).ready(function() {
        chart = new Highcharts.Chart({
            chart : {
                renderTo : 'container',
                type : 'line',
                marginRight : 130,
                marginBottom : 25
            },

            title : {
                text : 'Body Weight',
                x : -20 //center
            },
            xAxis : {
                categories : ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
            },

            yAxis : {
                title : {
                    text : 'Weight (lbs)'
                },
                plotLines …
Run Code Online (Sandbox Code Playgroud)

scope dynamic highcharts knockout.js

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

Tomcat + Spring Boot + 'javax.websocket.server.ServerContainer' 未找到

我正在尝试将带有 Web 套接字的 Spring Boot (2.0.5) Web 应用程序 (war) 部署到 Tomcat 8.5.37 服务器,它以前与 Tomcat 7 一起使用。我的 Web 套接字配置抛出异常并阻止应用程序启动. 我是否在 Spring 或 Tomcat 中缺少某种类型的配置?升级Tomcat后不再可用的东西?

我能够在本地运行(通过 eclipse 和 eclipse 的 Tomcat v8.5),但是当我尝试在我们的 qa 环境中部署到我们的 Tomcat 服务器时,我得到以下信息:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'createWebSocketContainer' defined in class path resource [com/soft/core/app/configuration/WebSocketConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Attribute 'javax.websocket.server.ServerContainer' not found in ServletContext
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1699)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:573)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495)
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:317)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:315)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:740)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869) …
Run Code Online (Sandbox Code Playgroud)

java spring spring-boot spring-websocket tomcat8.5

5
推荐指数
2
解决办法
4992
查看次数

Knockout.js在视图模型之外调用方法

我想在我的视图模型之外访问我的数据.所以我创建了一个视图模型对象,但是我无法绑定它的属性.请注意,一切都在我的视图模型中正常工作.

基本上是一个简化的伪代码:

function Users() {
    name;
    date;
}

function userHealthModel() {
     function createUsers() { new Users[] };
}

self.userModel = ko.observable(new userHealthModel());
self.userModel.createUsers();
Run Code Online (Sandbox Code Playgroud)

如果我createUsers在模型中调用方法,我的绑定工作正常.

这是一个jsFiddle,注意我的问题一直在JS的结尾,我评论它:http: //jsfiddle.net/fourgates/jpk22/1/

我是JS和KO的新手.不确定如何使用$ root,$ parent等.请帮助编程爱好者!提前谢谢了!

javascript data-binding highcharts knockout.js

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