小编mcv*_*mcv的帖子

如何为Bar Chart.js v2创建圆角条?

试图在条形图上围绕条形图,如在此帖子中找到的那样工作,如提供的jsFiddle中所示.这是针对版本1的.

在我使用的图表,它不能为参照负荷,以extend在Chart.types.Bar.extend崩溃的剧本.

如果我使用默认选项,图表不会加载任何问题.我必须Chart.types.Bar.extend在最后放置默认选项才能正确加载.在全屏幕中运行并查看此内容.

我尝试用我的Chart.js 2.4.0版本实现这个.

Chrome报告:

未捕获的TypeError:无法读取未定义的chart.js的属性"extend"

此代码甚至不会在这里运行.为什么会这样?有人可以帮助我.

此代码适用于旧版本的Chart.js 1.0.有谁可以请进一步展示如何使用版本Chart.js 2.0?谢谢.

$(document).ready(function(){

	var myBarChart1 = new Chart($('#appBarChart2_NoRound'), {
		type: 'bar',
		data: dataBar2,
		options: optionsBar
	});
  
  var ctx = $("#appBarChart2").getContext("2d");

  	var myBarChart2 = new Chart(ctx).BarAlt(dataBarAlt2, {
		// 0 (flat) to 1 (more curvy)
		curvature: 1
	});
});

var dataBarAlt2 = {
    labels: ["January", "February", "March", "April", "May", "June", "July"],
    datasets: [
        {
            fillColor: "#1A9BFC",
            strokeColor: "#1A9BFC",
            data: [65, 59, 80, 81, …
Run Code Online (Sandbox Code Playgroud)

javascript jquery chart.js

11
推荐指数
2
解决办法
7439
查看次数

htaccess 如何在 URL 重写后访问/获取搜索参数

我有一个基于提交的表单的 htaccess 重写规则。我正在尝试读取搜索参数,这是关键字搜索的一个简单示例,但理想情况下最终会添加更多参数:

单参数网址: //thesite.com/search?keyword=sample+text

2 参数网址: //thesite.com/search?keyword=sample+text&location=myCity

在我的 htacess 中,我有一个简单的重写规则来寻找这样的搜索:

RewriteRule ^.*search?(.*)$ /displayPage.php?page=search&options=$1
Run Code Online (Sandbox Code Playgroud)

我像这样访问选项参数:

$searchOptions = filter_input(INPUT_GET, "options")!==NULL?filter_input(INPUT_GET, "options"):'';
Run Code Online (Sandbox Code Playgroud)

当我输出这个变量时,它什么都没有。

我试过var_dump($_GET)了,结果是:

array (size=2)
  'page' => string 'search' (length=6)
  'options' => string '' (length=0)
Run Code Online (Sandbox Code Playgroud)

用于生成 url 的 html:

<form class="start-search" action="/search" method="get">
  <input id='keyword' name='keyword' class="search-str" type="text" value="" placeholder="Start Your Search">
  <!-- Meant to hold value for category -->
  <input class="search-cat" type="hidden" value="" placeholder="Start Your Search">

  <button class="btn" type="submit">
    <i class="fa fa-arrow-circle-o-right"></i>
  </button>
</form>
Run Code Online (Sandbox Code Playgroud)

我期待 $searchOptions 包含以下内容:

对于单个参数: …

html php forms .htaccess

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

Deployer - 致命错误:调用未定义的函数服务器()

部署者版本4.1.0

运行时dep deploy test报告以下错误:

PHP致命错误:调用未定义的函数服务器()

server ftn在配置文件中定义如下:

// Configure servers
server('test', 'test.server.com')
    ->user('user')
    ->identityFile('~/.ssh/id.pub', '~/.ssh/user', 'password')
    ->stage("test")
    ->env('deploy_path', '/var/www/project.com');  
Run Code Online (Sandbox Code Playgroud)

根据Deployer网站,这几乎是标准.还有其他人遇到过这个问题吗?如果是这样你是如何解决的?

php php-deployer

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

标签 统计

php ×2

.htaccess ×1

chart.js ×1

forms ×1

html ×1

javascript ×1

jquery ×1

php-deployer ×1