Я пытался создать графики с помощью библиотеки pchart на моем сайте drupal 7. Я правильно установил и настроил pchart, и когда я пытаюсь протестировать его на примере, предоставленном самим pcahrt, я получаю действительно бессмысленный вывод, как показано ниже ..
NPNG IHDR R
IDATxw \} O ^ WH \ ф + '!���M�&N����ɛ8yc'��$؉���
! РЕ] fǕF2jˬt}) г ܹ SF! X0 jZm @ QRGTӲm_Е $$$$$$ K4t
iVBWf% т
мы Օ H $ г! x7? pK'V7 @ _ ~,>] < ^ {- [у 晧 ~ t35Qn: О у) & | Aҫ-НН | GT e2mnN # ГВ ގ # !!!!] azzz / 59eī6 ؾ} 1 Tf 7߸ FX C0sA 輡 "!!!! M iiz͚5pb @ {{; я ( ж ܹ {O} S, VVzOOΝ; д, СН4 [и] ш ݹ s'0? vҗTYÔ =: ˹) ТТТ ݻ WW} ет ܸ qʪhsKKDfvTU09q6 NYP (
ǟ || | Xu ݜ2ʪ << qou4mwtt466nyr { tkk˶m6nbc перейти% l8lq ل г]] ד UR3 с <em>s6gmryp 8 s ) 9q ڵ g y y j b bŊ 'oz s i = "" 7ܰ cǎ d m p ( JJK = ""
у 朮 идти е +, {= "{| , |? Ne 44т} M»
и ~ г% 7 = ""
v] 9rg = ""> XY1 ض у ַ z'fYv9ˎO # у? Ӏ4 +} е% т
iVBW f% t iVBW f% tҀ 4 + $$$$$$ Y
s ^ Bc # Fq4 ^;
F1bĈkqh # F1b5 $ .r и Bc # FqCy! $ JEC # F1J 嵐 FA1bĈ2cH4 # F 1 {ּ тв% 1bĈ # F \ НМВС # Fx6h # F1b5 \ f2pvXu?2? ή #n ?? г [; 3; ڟ Е.К.
Bc # 3h SA p6 ތ j83
= ROeb # PhrO9J {1bĈ / 1ӛ; 5ktk6 | * + 15'qemM: ǤTUqO # F% P4 L
Это очень долго и является лишь частью вывода.
Когда я ставлю
<img src="sites/all/libraries/pChart2.1.3/examples/example.basic.php" />
строка на моей странице, ничего не получается, просто пустая страница с заголовком.
Я получаю этот бред, когда я включаю файл example.basic.php на мою страницу.
ниже приведен мой пример example.basic.php,
<?php
/* CAT:Misc */
//I have installed libraries module. and the contents of pChart are present in /sites/all/libraries/pChart2.1.3
$name = "pChart2.1.3";
if ($path = libraries_get_path($name)) {
include($path.'/class/pData.class.php');
include($path.'/class/pDraw.class.php');
include($path.'/class/pImage.class.php');
}
/* Include all the classes
include("../class/pDraw.class.php");
include("../class/pImage.class.php");
include("../class/pData.class.php"); */
/* Create your dataset object */
$myData = new pData();
/* Add data in your dataset */
$myData->addPoints(array(1,3,4,3,5));
/* Create a pChart object and associate your dataset */
$myPicture = new pImage(700,230,$myData);
/* Choose a nice font */
$myPicture->setFontProperties(array("FontName"=>$path.'/fonts/Forgotte.ttf',"FontSize"=>11));
/* Define the boundaries of the graph area */
$myPicture->setGraphArea(60,40,670,190);
/* Draw the scale, keep everything automatic */
$myPicture->drawScale();
/* Draw the scale, keep everything automatic */
$myPicture->drawSplineChart();
/* Render the picture (choose the best way) */
$myPicture->autoOutput("pictures/example.basic.png");
?>
FYI,
Я экспериментировал с рендерингом картинки, например,
$myPicture->autoOutput();
$myPicture->Stroke();
$myPicture->render();
Но все они дают одинаковый результат ..! Так, как я могу заставить это работать .. ??
/////////////// ДОБАВЛЕНО image.png код ////////////////////////// ////////////////////////////////////////////////// ///////////
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" version="XHTML+RDFa 1.0" dir="ltr"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:og="http://ogp.me/ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:sioc="http://rdfs.org/sioc/ns#"
xmlns:sioct="http://rdfs.org/sioc/types#"
xmlns:skos="http://www.w3.org/2004/02/skos/core#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
<head profile="http://www.w3.org/1999/xhtml/vocab">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta about="/d7/?q=node/2" property="sioc:num_replies" content="0" datatype="xsd:integer" />
<link rel="shortcut icon" href="http://localhost/d7/misc/favicon.ico" type="image/vnd.microsoft.icon" />
<meta content="test" about="/d7/?q=node/2" property="dc:title" />
<link rel="shortlink" href="/d7/?q=node/2" />
<meta name="Generator" content="Drupal 7 (http://drupal.org)" />
<link rel="canonical" href="/d7/?q=node/2" />
<title>test | project</title>
<style type="text/css" media="all">@import url("http://localhost/d7/modules/system/system.base.css?lzusma");
@import url("http://localhost/d7/modules/system/system.menus.css?lzusma");
@import url("http://localhost/d7/modules/system/system.messages.css?lzusma");
@import url("http://localhost/d7/modules/system/system.theme.css?lzusma");</style>
<style type="text/css" media="all">@import url("http://localhost/d7/modules/comment/comment.css?lzusma");
@import url("http://localhost/d7/sites/all/modules/date/date_api/date.css?lzusma");
@import url("http://localhost/d7/sites/all/modules/date/date_popup/themes/datepicker.1.7.css?lzusma");
@import url("http://localhost/d7/modules/field/theme/field.css?lzusma");
@import url("http://localhost/d7/modules/node/node.css?lzusma");
@import url("http://localhost/d7/modules/search/search.css?lzusma");
@import url("http://localhost/d7/modules/user/user.css?lzusma");</style>
<style type="text/css" media="all">@import url("http://localhost/d7/themes/bartik/css/layout.css?lzusma");
@import url("http://localhost/d7/themes/bartik/css/style.css?lzusma");
@import url("http://localhost/d7/themes/bartik/css/colors.css?lzusma");</style>
<style type="text/css" media="print">@import url("http://localhost/d7/themes/bartik/css/print.css?lzusma");</style>
<!--[if lte IE 7]>
<link type="text/css" rel="stylesheet" href="http://localhost/d7/themes/bartik/css/ie.css?lzusma" media="all" />
<![endif]-->
<!--[if IE 6]>
<link type="text/css" rel="stylesheet" href="http://localhost/d7/themes/bartik/css/ie6.css?lzusma" media="all" />
<![endif]-->
<script type="text/javascript" src="http://localhost/d7/misc/jquery.js?v=1.4.4"></script>
<script type="text/javascript" src="http://localhost/d7/misc/jquery.once.js?v=1.2"></script>
<script type="text/javascript" src="http://localhost/d7/misc/drupal.js?lzusma"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, {"basePath":"\/d7\/","pathPrefix":"","ajaxPageState":{"theme":"bartik","theme_token":"QE-jd8WcXtpZ1dRuiSRy-AooAlkyyPIGI7vF2twO1Js","js":{"misc\/jquery.js":1,"misc\/jquery.once.js":1,"misc\/drupal.js":1},"css":{"modules\/system\/system.base.css":1,"modules\/system\/system.menus.css":1,"modules\/system\/system.messages.css":1,"modules\/system\/system.theme.css":1,"modules\/comment\/comment.css":1,"sites\/all\/modules\/date\/date_api\/date.css":1,"sites\/all\/modules\/date\/date_popup\/themes\/datepicker.1.7.css":1,"modules\/field\/theme\/field.css":1,"modules\/node\/node.css":1,"modules\/search\/search.css":1,"modules\/user\/user.css":1,"themes\/bartik\/css\/layout.css":1,"themes\/bartik\/css\/style.css":1,"themes\/bartik\/css\/colors.css":1,"themes\/bartik\/css\/print.css":1,"themes\/bartik\/css\/ie.css":1,"themes\/bartik\/css\/ie6.css":1}}});
//--><!]]>
</script>
</head>
<body class="html not-front not-logged-in one-sidebar sidebar-first page-node page-node- page-node-2 node-type-article" >
<div id="skip-link">
<a href="#main-content" class="element-invisible element-focusable">Skip to main content</a>
</div>
<div id="page-wrapper"><div id="page">
<div id="header" class="without-secondary-menu"><div class="section clearfix">
<a href="/d7/" title="Home" rel="home" id="logo">
<img src="http://localhost/d7/themes/bartik/logo.png" alt="Home" />
</a>
<div id="name-and-slogan">
<div id="site-name">
<strong>
<a href="/d7/" title="Home" rel="home"><span>project</span></a>
</strong>
</div>
</div> <!-- /#name-and-slogan -->
<div id="main-menu" class="navigation">
<h2 class="element-invisible">Main menu</h2><ul id="main-menu-links" class="links clearfix"><li class="menu-218 first last"><a href="/d7/">Home</a></li>
</ul> </div> <!-- /#main-menu -->
</div></div> <!-- /.section, /#header -->
<div id="main-wrapper" class="clearfix"><div id="main" class="clearfix">
<div id="breadcrumb"><h2 class="element-invisible">You are here</h2><div class="breadcrumb"><a href="/d7/">Home</a></div></div>
<div id="sidebar-first" class="column sidebar"><div class="section">
<div class="region region-sidebar-first">
<div id="block-user-login" class="block block-user">
<h2>User login</h2>
<div class="content">
<form action="/d7/?q=node/2&destination=node/2" method="post" id="user-login-form" accept-charset="UTF-8"><div><div class="form-item form-type-textfield form-item-name">
<label for="edit-name">Username <span class="form-required" title="This field is required.">*</span></label>
<input type="text" id="edit-name" name="name" value="" size="15" maxlength="60" class="form-text required" />
</div>
<div class="form-item form-type-password form-item-pass">
<label for="edit-pass">Password <span class="form-required" title="This field is required.">*</span></label>
<input type="password" id="edit-pass" name="pass" size="15" maxlength="60" class="form-text required" />
</div>
<div class="item-list"><ul><li class="first"><a href="/d7/?q=user/register" title="Create a new user account.">Create new account</a></li>
<li class="last"><a href="/d7/?q=user/password" title="Request new password via e-mail.">Request new password</a></li>
</ul></div><input type="hidden" name="form_build_id" value="form-1CLdTDBqbmne6F7FjhizZLAe-9XZmCIa__KHgtmPeP8" />
<input type="hidden" name="form_id" value="user_login_block" />
<div class="form-actions form-wrapper" id="edit-actions"><input type="submit" id="edit-submit" name="op" value="Log in" class="form-submit" /></div></div></form> </div>
</div>
</div>
</div></div> <!-- /.section, /#sidebar-first -->
<div id="content" class="column"><div class="section">
<a id="main-content"></a>
<h1 class="title" id="page-title">
test </h1>
<div class="tabs">
</div>
<div class="region region-content">
<div id="block-system-main" class="block block-system">
<div class="content">
<div id="node-2" class="node node-article node-promoted node-full clearfix" about="/d7/?q=node/2" typeof="sioc:Item foaf:Document">
<div class="meta submitted">
<span property="dc:date dc:created" content="2012-02-24T00:32:36+05:30" datatype="xsd:dateTime" rel="sioc:has_creator">Submitted by <span class="username" xml:lang="" about="/d7/?q=user/1" typeof="sioc:UserAccount" property="foaf:name">akshaynhegde</span> on Fri, 02/24/2012 - 00:32</span> </div>
<div class="content clearfix">
<div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded">HELLoo
Следующая часть - это бессмысленный код .. поэтому я не могу вставить его, так что вот картинка этого бессмысленного кода ...
После тарабарщины есть еще немного кода .. как показано ниже,
<img src="/sites/all/libraries/pChart2.1.3/examples/example.basic.php" /></div></div></div> </div>
<div class="link-wrapper">
<ul class="links inline"><li class="comment_forbidden first last"><span><a href="/d7/?q=user/login&destination=node/2%23comment-form">Log in</a> or <a href="/d7/?q=user/register&destination=node/2%23comment-form">register</a> to post comments</span></li>
</ul> </div>
</div>
</div>
</div>
</div>
</div></div> <!-- /.section, /#content -->
</div></div> <!-- /#main, /#main-wrapper -->
<div id="footer-wrapper"><div class="section">
<div id="footer" class="clearfix">
<div class="region region-footer">
<div id="block-system-powered-by" class="block block-system">
<div class="content">
<span>Powered by <a href="http://drupal.org">Drupal</a></span> </div>
</div>
</div>
</div> <!-- /#footer -->
</div></div> <!-- /.section, /#footer-wrapper -->
</div></div> <!-- /#page, /#page-wrapper -->
</body>
</html>