نمودارهای رادار

این سند نحوه ایجاد نمودارهای راداری با استفاده از Chart API را شرح می دهد.

فهرست مطالب

بررسی اجمالی

در نمودار رادار، نقاط داده به طور مساوی در جهت عقربه های ساعت در اطراف نمودار رسم می شوند. مقدار نقطه به عنوان فاصله از مرکز نمودار نشان داده می شود، جایی که مرکز نشان دهنده حداقل مقدار و لبه نمودار حداکثر مقدار است. هر سری به عنوان یک مدار کامل از نمودار ترسیم می شود. نمودار این نقاط را با خطوط مستقیم یا منحنی، همانطور که شما مشخص می کنید، به هم متصل می کند. بنابراین، نمودار رادار اساساً یک نمودار خطی است که در یک دایره پیچیده شده است، که در آن محور y از مرکز نمودار به محیط می رود، و محور x محیط نمودار است که در 12 شروع و به پایان می رسد: خط 00.

نمودار به طور مساوی به بخش های مساوی تقسیم می شود. تعداد بخش ها بزرگتر از این دو مقدار است:

  • تعداد برچسب ها + 1 (همانطور که توسط chxl مشخص شده است، در صورت وجود)، یا
  • تعداد مقادیر داده

بنابراین، برای مثال، اگر نموداری با هشت نقطه داده و بدون برچسب دارید، نقاط داده با فاصله 45 درجه از هم (360/8) قرار می گیرند.

اگر چند سری داشته باشید، سری هایی که بیشترین امتیاز را داشته باشد، شمارش می شود. حداقل تعداد بخش ها چهار است. اگر کمتر از چهار برچسب یا نقطه داده داشته باشید، نمودار به طور پیش فرض به چهار بخش تبدیل می شود. برای ایجاد یک مدار کامل از نمودار به n+1 نقطه داده نیاز دارید، جایی که n تعداد قطعات است. نقاط داده بیشتر باعث افزایش جزئیات نمودار می شود. داده های شما هرگز بیش از یک بار دور نمودار نمی چرخند.

نمودار رادار می تواند چندین سری را پشتیبانی کند. هر سری یک خط در نمودار است.

شرح مثال

برای نموداری از نوع r ، نقاط با خطوط مستقیم به هم متصل می شوند.

این مثال یک نمودار راداری ساده با یک سری داده را نشان می دهد. مقادیر به تدریج افزایش می یابد، که ظاهری به پوسته حلزون می دهد.

Radar chart
cht=r
chd=t:10,20,30,40,50,60,70,80,90

هنگامی که برچسب های محور x در نمودار راداری گنجانده می شوند، فاصله نقاط داده در اطراف نمودار با تعداد برچسب ها یا تعداد نقاط داده، هر کدام بزرگتر باشد، تعیین می شود. در هر دو این نمودار، تعداد نقاط داده یکسان است (پنج)، اما اولی دارای برچسب های کمتر و دومی دارای برچسب های بیشتری است. نمودار اول مکان های داده را با توجه به تعداد نقاط داده و نمودار دوم با توجه به تعداد برچسب ها اختصاص می دهد. توجه داشته باشید که نمودار دوم دارای شش بخش است که هفت نقطه برای ایجاد یک دایره کامل می دهد.


chd=t:10,20,30,40,50
chxl=0:|1|2|3|4

نمودار با 5 نقطه داده، 4 برچسب.
داده ها در فواصل 360/5=72 درجه



chd=t:10,20,30,40,50
chxl=0:|1|2|3|4|5|6

نمودار با 6 برچسب، 5 نقطه داده.
داده ها در فواصل 360/6=60 درجه.

می‌توانید با افزودن رنگ‌ها، سبک‌های خط و برچسب‌های محور، اطلاعات و وضوح بیشتری به نمودار رادار اضافه کنید.

این مثال یک نمودار راداری پیچیده تر با دو سری داده است. رنگ هر سری داده با chco مشخص می شود، همانطور که در رنگ های سری توضیح داده شده است.

سبک های خط با chls مشخص می شوند، همانطور که در سبک های خط توضیح داده شده است.

برچسب‌های محور با chxt ، chxl ، و chxr مشخص می‌شوند، همانطور که در سبک‌ها و برچسب‌های محور توضیح داده شده است. برای نمودارهای رادار، محور x به صورت دایره ای در اطراف محیط نمودار رسم می شود و محورهای y و r از مرکز نمودار به سمت بالا می روند. محور t نادیده گرفته می شود. این نمودار شامل برچسب های محور x است که ممکن است مقادیر را در مکان های مختلف قطب نما نشان دهد (به عنوان مثال، سرعت باد).

Radar chart
chco=FF0000,FF9900
chls=2.0,4.0,0.0|2.0,4.0,0.0
chxt=x
chxl=0:|0|45|90|135|180|225|270|315
chxr=0,0.0,360.0

در نمودارهای نوع rs نقاط با خطوط منحنی به هم متصل می شوند.

این مثال از پارامترهای مشابه مثال قبلی استفاده می کند، اما دارای یک خط پر شده برای هر دو سری داده است.

این مثال شامل خطوط شبکه است.

Radar chart with line fills
chg=25.0,25.0,4.0,4.0
chm=
B,FF000080,0,1.0,5.0|
B,FF990080,1,1.0,5.0

در نمودارهای رادار، نشانگرهای خط افقی به صورت دایره ای خم می شوند و نشانگرهای خط عمودی، همانطور که در اینجا نشان داده شده است، از مرکز به بیرون تابش می کنند.

  • chm=h,0000FF,... - دایره آبی تیره. توجه داشته باشید که چگونه نشانگرهای شکل خط افقی یک دایره را در نمودار رادار ایجاد می کنند.
  • chm=V,00FF0080,... - خط سبز ساعت 6:00.

برای اطلاعات بیشتر در مورد اشکال موجود ، نشانگرهای شکل را ببینید.

Radar chart
chm=
h,0000FF,0,1.0,4.0
V,00FF00,0,4.0,5.0

بازگشت به بالا

انواع نمودار ( cht )

دو نوع نمودار رادار وجود دارد: نمودار خط مستقیم ( cht=r ) نمودار خط منحنی ( cht=rs ).

پارامتر شرح مثال
r

برای نموداری از نوع r ، نقاط با خطوط مستقیم به هم متصل می شوند.

Radar chart
cht=r
chd=t:10,20,30,40,50,60

rs نوع نمودار rs نقاط را با خطوط منحنی به هم متصل می کند. Radar chart
cht=rs
chd=t:10,20,30,40,50,60,70,80,90

بازگشت به بالا

سری رنگ ها chco

به صورت اختیاری رنگ خطوط را با استفاده از پارامتر chco مشخص کنید.

نحو

chco=<color_1>,...,<color_n>
< رنگ >
یک یا چند رنگ خط را در قالب هگزادسیمال RRGGBB که با کاما از هم جدا شده اند، مشخص کنید. اگر تعداد خطوط بیشتر از رنگ‌ها باشد، خطوط اضافی از ابتدا در فهرست رنگ‌ها گردش می‌کنند.

ویژگی های استاندارد

بقیه ویژگی های این صفحه ویژگی های نمودار استاندارد هستند.

عنوان نمودار chtt , chts [ همه نمودارها ]

می توانید متن عنوان، رنگ و اندازه قلم را برای نمودار خود مشخص کنید.

نحو

chtt=<chart_title>
chts=<color>,<font_size>,<opt_alignment>

chtt - عنوان نمودار را مشخص می کند.

< چارت_عنوان >
عنوانی که باید برای نمودار نشان داده شود. شما نمی توانید مشخص کنید که کجا ظاهر شود، اما می توانید به صورت اختیاری اندازه و رنگ فونت را مشخص کنید. برای نشان دادن فاصله ها از علامت + و برای نشان دادن شکستگی ها از کاراکتر لوله ( | ) استفاده کنید.

chts [ اختیاری ] - رنگ ها و اندازه قلم برای پارامتر chtt .

<رنگ >
رنگ عنوان، در قالب هگزادسیمال RRGGBB . رنگ پیش فرض مشکی است.
<font_size >
اندازه قلم عنوان، بر حسب امتیاز.
< opt_alignment >
[ اختیاری ] تراز عنوان. یکی از مقادیر رشته حساس به حروف بزرگ زیر را انتخاب کنید: "l" (چپ)، "c" (مرکز) "r" (راست). پیش فرض "c" است.

مثال ها

شرح مثال

نموداری با عنوان، با استفاده از رنگ و اندازه فونت پیش‌فرض.

یک فاصله با علامت مثبت ( + ) مشخص کنید.

از یک کاراکتر لوله ( | ) برای اجبار شکستن خط استفاده کنید.

chts در اینجا مشخص نشده است.

Vertical bar chart with title
chtt=Site+visitors+by+month|
January+to+July

نموداری با عنوان آبی، تراز راست، 20 نقطه‌ای.

Vertical bar chart with blue, 20 pixel, title
chtt=Site+visitors
chts=FF0000,20,r

بازگشت به بالا

متن و سبک افسانه نمودار chdl , chdlp , chdls [ همه نمودارها ]

افسانه یک بخش جانبی از نمودار است که شرح متنی کوچکی از هر سری ارائه می دهد. می توانید متن مربوط به هر سری را در این افسانه مشخص کنید و مشخص کنید که در کجای نمودار باید ظاهر شود.

همچنین chma مراجعه کنید تا یاد بگیرید که چگونه حاشیه ها را در اطراف افسانه خود تنظیم کنید.

نکته ای در مورد مقادیر رشته: فقط کاراکترهای ایمن URL در رشته های برچسب مجاز هستند. برای ایمن بودن، باید رشته‌های حاوی نویسه‌هایی را که در مجموعه کاراکتر 0-9a-zA-Z نیستند، URL-encode کنید. می‌توانید یک رمزگذار URL را در اسناد تجسم Google بیابید.

نحو

chdl=<data_series_1_label>|...|<data_series_n_label>
chdlp=<opt_position>|<opt_label_order>
chdls=<color>,<size>

chdl - متن هر سری، برای نمایش در افسانه.

< data_series_label >
متن برای ورودی های افسانه. هر برچسب برای سری مربوطه در آرایه chd اعمال می شود. از علامت + برای فاصله استفاده کنید. اگر این پارامتر را مشخص نکنید، نمودار یک افسانه دریافت نمی کند. هیچ راهی برای تعیین شکست خط در یک برچسب وجود ندارد. افسانه معمولاً برای نگه داشتن متن افسانه شما گسترش می یابد و ناحیه نمودار کوچک می شود تا افسانه را در خود جای دهد.

chdlp - [ اختیاری ] موقعیت افسانه و ترتیب ورودی های افسانه. می توانید < position > و/یا < label_order > را مشخص کنید. اگر هر دو را مشخص کردید، آنها را با یک کاراکتر نوار جدا کنید. اگر می‌خواهید ورودی‌های افسانه خالی در chdl در افسانه حذف شوند، می‌توانید یک 's' به هر مقدار اضافه کنید. مثال‌ها: chdlp=bv ، chdlp=r ، chdlp=bv|r ، chdlp=bvs|r

< opt_position >
[ اختیاری ] موقعیت افسانه را در نمودار مشخص می کند. برای تعیین بالشتک اضافی بین افسانه و ناحیه نمودار یا حاشیه تصویر، از پارامتر chma استفاده کنید. یکی از مقادیر زیر را انتخاب کنید:
  • b - افسانه در پایین نمودار، نوشته های افسانه در یک ردیف افقی.
  • bv - افسانه در پایین نمودار، ورودی های افسانه در یک ستون عمودی.
  • t - افسانه در بالای نمودار، ورودی های افسانه در یک ردیف افقی.
  • tv - افسانه در بالای نمودار، ورودی های افسانه در یک ستون عمودی.
  • r - [ پیش‌فرض ] افسانه در سمت راست نمودار، ورودی‌های افسانه در یک ستون عمودی.
  • l - افسانه در سمت چپ نمودار، ورودی های افسانه در یک ستون عمودی.
< opt_label_order >
[ اختیاری ] ترتیب نشان داده شدن برچسب ها در افسانه. یکی از مقادیر زیر را انتخاب کنید:
  • l - [ پیش‌فرض برای افسانه‌های عمودی ] برچسب‌ها را به ترتیبی که به chdl داده شده است نمایش دهید.
  • r - برچسب ها را به ترتیب معکوس مطابق با chdl نمایش دهید. این در نمودارهای میله ای انباشته برای نشان دادن افسانه مفید است
    به همان ترتیبی که میله ها ظاهر می شوند.
  • a - [ پیش‌فرض برای افسانه‌های افقی ] مرتب‌سازی خودکار: تقریباً به معنای مرتب‌سازی بر اساس طول، ابتدا کوتاه‌ترین، همانطور که در بلوک‌های 10 پیکسلی اندازه‌گیری می‌شود. هنگامی که دو عنصر دارای طول یکسان هستند (به بلوک های 10 پیکسلی تقسیم می شوند)، عنصری که ابتدا لیست شده است ابتدا ظاهر می شود.
  • 0,1,2... - سفارش لیبل سفارشی. این فهرستی از شاخص‌های برچسب مبتنی بر صفر از chdl است که با کاما از هم جدا شده‌اند.

chdls - [ اختیاری ] رنگ و اندازه قلم متن افسانه را مشخص می کند.

< رنگ >
رنگ متن افسانه، در قالب هگزادسیمال RRGGBB .
< اندازه >
اندازه نقطه متن افسانه.

مثال ها

شرح مثال

دو نمونه از افسانه ها متن افسانه را به همان ترتیب سری داده های خود مشخص کنید.

Red, blue, and green line chart with matching legends

chdl=NASDAQ|FTSE100|DOW
chco=FF0000,00FF00,0000FF

Venn diagram with two smaller circles enclosed by a larger circle


chdl=First|Second|Third
chco=ff0000,00ff00,0000ff

نمودار اول ورودی‌های افسانه افقی را نشان می‌دهد ( chdlp=t ، طرح‌بندی پیش‌فرض افقی است)، و نمودار دوم ورودی‌های افسانه عمودی پایین ( chdlp=bv ) را نشان می‌دهد.

Venn diagram with two smaller circles enclosed by a larger circle
chdl=First|Second|Third
chco=ff0000,00ff00,0000ff
chdlp=t


Venn diagram with two smaller circles enclosed by a larger circle
chdl=First|Second|Third
chco=ff0000,00ff00,0000ff
chdlp=bv

این مثال تغییر اندازه فونت را نشان می دهد.

Venn diagram with two smaller circles enclosed by a larger circle
chdls=0000CC,14

بازگشت به بالا

حاشیه های نمودار chma [ همه نمودارها ]

می توانید اندازه حاشیه های نمودار را بر حسب پیکسل مشخص کنید. حاشیه ها از اندازه نمودار مشخص شده ( chs ) به سمت داخل محاسبه می شوند. افزایش اندازه حاشیه، اندازه کل نمودار را افزایش نمی دهد، بلکه در صورت لزوم، منطقه نمودار را کوچک می کند.

حاشیه ها به طور پیش فرض هر چیزی است که پس از محاسبه اندازه نمودار باقی می ماند. این مقدار پیش فرض بسته به نوع نمودار متفاوت است. حاشیه هایی که شما مشخص می کنید حداقل مقدار هستند. اگر ناحیه نمودار جایی برای حاشیه باقی بگذارد، اندازه حاشیه همان چیزی است که باقی مانده است. شما نمی توانید حاشیه ها را کوچکتر از آنچه برای هر افسانه و برچسب لازم است فشار دهید. در اینجا نموداری وجود دارد که بخش های اصلی یک نمودار را نشان می دهد:

حاشیه نمودار، ناحیه افسانه و ناحیه نمودار

حاشیه های نمودار شامل برچسب های محور و ناحیه افسانه است. اندازه ناحیه افسانه به طور خودکار تغییر می‌کند تا دقیقاً با متن مطابقت داشته باشد، مگر اینکه با استفاده از chma عرض بزرگ‌تری را مشخص کنید، در این صورت اندازه حاشیه را گسترده‌تر می‌کند و ناحیه نمودار را کوچک‌تر می‌کند. شما نمی توانید یک افسانه را با تعیین اندازه بسیار کوچک برش دهید، اما می توانید کاری کنید که فضای بیشتری از آنچه نیاز دارد اشغال کند.

نکته: در نمودار میله‌ای، اگر میله‌ها اندازه ثابتی داشته باشند (پیش‌فرض)، پهنای ناحیه نمودار را نمی‌توان کاهش داد. شما باید اندازه نوار کوچکتر یا قابل تغییر اندازه را با استفاده از chbh مشخص کنید.

نحو

chma=
  <left_margin>,<right_margin>,<top_margin>,<bottom_margin>|<opt_legend_width>,<opt_legend_height>
< margin_left >، < right_margin >، < top_margin >، < bottom_margin >
حداقل اندازه حاشیه در اطراف منطقه نمودار، بر حسب پیکسل. برای جلوگیری از برخورد برچسب‌های محور با مرزهای نمودار، این مقدار را افزایش دهید تا مقداری بالشتک اضافه شود.
< opt_legend_width >، < opt_legend_height >
[ اختیاری ] عرض حاشیه اطراف افسانه، بر حسب پیکسل. از این برای جلوگیری از برخورد افسانه در ناحیه نمودار یا لبه های تصویر استفاده کنید.

مثال ها

شرح مثال

در این مثال، نمودار دارای حداقل حاشیه 30 پیکسل در هر طرف است. از آنجایی که پهنای افسانه نمودار بیش از 30 پیکسل است، حاشیه سمت راست به عرض نمودار نمودار تنظیم می شود و با حاشیه های دیگر متفاوت است.

برچسب های محور خارج از منطقه طرح هستند و بنابراین در فضای حاشیه ترسیم می شوند.

Line chart with gray background and margins on each side.
chma=30,30,30,30

برای اضافه کردن حاشیه در اطراف افسانه، مقداری را برای پارامترهای < opt_legend_width > و < opt_legend_height > تنظیم کنید.

در این مثال، پهنای افسانه تقریباً 60 پیکسل است. اگر < opt_legend_width > روی 80 پیکسل تنظیم کنید، حاشیه به 20 پیکسل در خارج از افسانه افزایش می یابد.

Line chart with gray background and margins on each side.
chma=20,20,20,30|80,20

بازگشت به بالا

سبک‌ها و برچسب‌های محور [ خط، نوار، Google-o-meter، Radar، Scatter ]

می توانید مشخص کنید که کدام محورها در نمودار نمایش داده شوند و به آنها برچسب ها و موقعیت ها، محدوده ها و سبک های سفارشی بدهید.

همه نمودارها خطوط محور را به طور پیش فرض نشان نمی دهند. با استفاده از پارامتر chxt می توانید دقیقا مشخص کنید که نمودار شما چه محورهایی را نشان دهد. خطوط محور پیش فرض اعداد را نشان نمی دهند. برای نمایش اعداد باید یک محور در پارامتر chxt مشخص کنید.

می‌توانید انتخاب کنید که محورهای شما اعدادی را نشان دهند که مقادیر داده‌ها را منعکس می‌کنند، یا می‌توانید محورهای سفارشی را مشخص کنید. پیش‌فرض نمایش مقادیر عددی است، با مقادیری که از 0 تا 100 مقیاس شده‌اند. با این حال، می‌توانید آن محدوده را با استفاده از chxr برای نمایش هر محدوده تغییر دهید، و می‌توانید مقادیر (مثلاً برای نشان دادن نمادهای ارز یا اعشار) با استفاده از chxs استایل دهید.

اگر انتخاب می کنید از مقادیر سفارشی استفاده کنید، به عنوان مثال: "Mon, Tues, Wed"، می توانید از پارامتر chxl استفاده کنید. برای قرار دادن این برچسب ها در مکان های خاص در امتداد محور، از پارامتر chxp استفاده کنید.

در نهایت، می‌توانید از پارامترهای chxs و chxtc برای تعیین رنگ، اندازه، تراز و سایر ویژگی‌های برچسب‌های محور سفارشی و عددی استفاده کنید.

نکته ای در مورد مقادیر رشته: فقط کاراکترهای ایمن URL در رشته های برچسب مجاز هستند. برای ایمن بودن، باید رشته‌های حاوی نویسه‌هایی را که در مجموعه کاراکتر 0-9a-zA-Z نیستند، URL-encode کنید. می‌توانید یک رمزگذار URL را در اسناد تجسم Google بیابید.

این بخش موضوعات زیر را پوشش می دهد:


محورهای قابل مشاهده chxt

نمودارهای میله ای، خطی، رادار و پراکنده به طور پیش فرض یک یا دو خط محور را نشان می دهند، اما این خطوط شامل مقادیر نمی شوند. برای نمایش مقادیر در خطوط محور خود، یا برای تغییر اینکه کدام محور نشان داده می شود، باید از پارامتر chxt استفاده کنید. به‌طور پیش‌فرض، مقادیر محورها از 0 تا 100 متغیر است، مگر اینکه آنها را به‌صراحت با استفاده از ویژگی chxr مقیاس کنید. برای پنهان کردن تمام خطوط محور در نمودار خطی، :nda بعد از مقدار نوع نمودار در پارامتر cht مشخص کنید (مثال: cht= lc:nda ).

به طور پیش‌فرض، محورهای بالا و پایین علامت‌های تیک را با مقادیر نشان نمی‌دهند، در حالی که محورهای چپ و راست آن‌ها را نشان می‌دهند. می توانید این رفتار را با استفاده از پارامتر chxs تغییر دهید.

نحو

chxt=
  <axis_1>
    ,...,
  <axis_n>
< محور >
محوری برای نشان دادن در نمودار. محورهای موجود عبارتند از:
  • x - محور x پایین
  • t - محور x بالا [ توسط Google-o-Meter پشتیبانی نمی‌شود ]
  • y - محور y چپ
  • r - محور y راست [ توسط Google-o-Meter پشتیبانی نمی‌شود ]

می توانید چندین محور از یک نوع را مشخص کنید، به عنوان مثال: cht=x,x,y . با این کار دو مجموعه از محورهای x در امتداد پایین نمودار قرار می گیرند. این هنگام افزودن برچسب های سفارشی در امتداد محوری که مقادیر عددی را نشان می دهد مفید است (به مثال زیر مراجعه کنید). محورها از داخل به بیرون کشیده می شوند، بنابراین اگر x,x دارید، x اول به درونی ترین کپی، x بعدی به کپی رو به بیرون بعدی اشاره دارد و غیره.

مثال ها

شرح مثال

این مثال نمودار خطی را با محور x، محور y، محور بالا (t) و محور راست (r) نشان می‌دهد.

از آنجایی که هیچ برچسبی مشخص نشده است، نمودار به طور پیش فرض محدوده 0 تا 100 را برای همه محورها تعیین می کند.

توجه داشته باشید که به‌طور پیش‌فرض، محورهای بالا و پایین علامت‌های تیک را روی برچسب‌ها نشان نمی‌دهند.

Line chart with the labels: 0, 20, 40, 60, 80, and 100 on the left and right and labels: 0, 25, 50, 75, and 100 above and below
chxt=x,y,r,t

می‌توانید چندین مجموعه از برچسب‌ها را برای هر محور با اضافه کردن یک مقدار بیش از یک بار اضافه کنید. این مثال دو مجموعه x و دو مجموعه محور y را نشان می دهد. این به ویژه هنگام استفاده از برچسب های محور پیش فرض، همانطور که در اینجا نشان داده شده است، مفید نیست. اما با استفاده از پارامتر chxl می‌توانید برچسب‌های سفارشی را برای هر کپی از هر محور مشخص کنید.

chxt=x,x,y,y


chxt=x,x,y,y
chxl=
1:|یخ زدن|گرم|
3:|کم|بالا

این مثال نمودار میله‌ای افقی را با محور x، محور y، محور t بالا و محور راست نشان می‌دهد.

برچسب‌های محور حذف شده‌اند، بنابراین نمودار API محدوده 0 تا 100 را برای محور x و برای محور t نمایش می‌دهد.

محدوده برای محور y و برای محور r با تعداد میله ها تعیین می شود. در این مورد، پنج نوار وجود دارد، بنابراین Chart API محدوده 0 تا 4 را نمایش می دهد. برچسب اول در مرکز میله اول، برچسب دوم در مرکز پایه نوار دوم و غیره قرار دارد. .

Line chart with the labels: 0, 20, 40, 60, 80, and 100 on the left and right and labels: 0, 25, 50, 75, and 100 above and below
chxt=x,y,r,t

می توانید محورهای پیش فرض را در نمودار خطی با تعیین :nda بعد از نوع نمودار سرکوب کنید. Line chart with hidden axes
cht=lc:nda

بازگشت به بالا

محدوده محوری chxr

با استفاده از پارامتر chxr می توانید محدوده مقادیری را که در هر محور به طور مستقل ظاهر می شوند مشخص کنید. توجه داشته باشید که این کار مقیاس عناصر نمودار را تغییر نمی دهد، فقط مقیاس برچسب های محور را تغییر می دهد. اگر می‌خواهید اعداد محورها مقادیر واقعی داده‌ها را توصیف کنند، < start_val > و < end_val > را به ترتیب روی مقادیر پایین‌تر و بالای محدوده قالب داده‌تان تنظیم کنید. برای اطلاعات بیشتر به Axis Scaling مراجعه کنید.

اگر می خواهید محدوده آن را مشخص کنید، باید با استفاده از پارامتر chxt یک محور را قابل مشاهده کنید.

برای تعیین مقادیر محور سفارشی، از پارامتر chxl استفاده کنید.

نحو

محدوده های برچسب چند محور را با استفاده از کاراکتر لوله ( | ) جدا کنید.

chxr=
  <axis_index>,<start_val>,<end_val>,<opt_step>
    |...|
  <axis_index>,<start_val>,<end_val>,<opt_step>
<axis_index >
برچسب ها را روی کدام محور اعمال کنیم. این یک شاخص مبتنی بر صفر در آرایه محوری است که توسط chxt مشخص شده است. به عنوان مثال، محور r در chxt=x,r,y 1 خواهد بود.
< start_val >
عددی که مقدار کم را برای این محور تعریف می کند.
< end_val >
عددی که مقدار بالایی را برای این محور تعیین می کند.
< opt_step >
[ اختیاری ] مرحله شمارش بین تیک ها روی محور. هیچ مقدار مرحله پیش فرض وجود ندارد. این مرحله برای نشان دادن مجموعه ای از برچسب ها با فاصله خوب محاسبه می شود.

مثال ها

شرح مثال

این مثال محورهای y چپ و راست ( y و r ) و یک محور x ( x ) را نشان می دهد.

هر محور یک محدوده تعریف شده دارد. از آنجایی که هیچ برچسب یا موقعیتی مشخص نشده است، مقادیر از محدوده داده شده گرفته می شوند و به طور مساوی در آن محدوده قرار می گیرند. در نمودار خطی، مقادیر به طور مساوی در امتداد محور x پخش می شوند.

جهت محور برای محور r معکوس می شود (شاخص 2 )، زیرا اولین مقدار ( 1000 ) بزرگتر از آخرین مقدار ( 0 ) است.


chxt=x,y,r
chxr=
0,0,500|
1,0,200|
2,1000,0

در این مثال مقادیری برای محور x مشخص شده است.

برچسب های محور به طور مساوی در امتداد محور قرار گرفته اند. مقدار پنج ( 5 ) برای پارامتر < opt_step > مشخص شده است.

Bar chart with 200, 300, and 400 on the x-axis chxt=x
chxr=0,10,50,5

بازگشت به بالا

برچسب های محور سفارشی chxl

با استفاده از پارامتر chxl می‌توانید برچسب‌های محور رشته‌ای سفارشی را در هر محوری مشخص کنید. می توانید هر تعداد برچسب را که دوست دارید مشخص کنید. اگر یک محور را نمایش دهید (با استفاده از پارامتر chxt ) و برچسب های سفارشی را مشخص نکنید، برچسب های استاندارد و عددی اعمال می شوند. برای تعیین محدوده عددی سفارشی، به جای آن از پارامتر chxr استفاده کنید.

برای تنظیم مکان های خاص در امتداد محور برای برچسب های خود، از پارامتر chxp استفاده کنید.

نحو

برای هر محوری که می خواهید برچسب گذاری کنید یک مجموعه پارامتر مشخص کنید. چندین مجموعه از برچسب ها را با استفاده از کاراکتر لوله ( | ) جدا کنید.

chxl=
  <axis_index>:|<label_1>|...|<label_n>
    |...|
  <axis_index>:|<label_1>|...|<label_n>
<axis_index >
برچسب ها را روی کدام محور اعمال کنیم. این یک شاخص در آرایه پارامتر chxt است. به عنوان مثال، اگر chxt=x,x,y,y داشته باشید، شاخص 0 اولین محور x و 1 دومین محور x خواهد بود.
<label_1> | ... |< label_n >
یک یا چند برچسب برای قرار دادن در امتداد این محور. اینها می توانند مقادیر رشته یا عدد باشند. لازم نیست رشته ها در گیومه باشند. label_1 در پایین ترین موقعیت محور و label_n در بالاترین موقعیت نمایش داده می شود. برچسب های اضافی به طور مساوی بین آنها قرار می گیرند. فاصله ها را با علامت + نشان دهید. هیچ راهی برای تعیین شکست خط در یک برچسب وجود ندارد. برچسب ها را با یک کاراکتر لوله جدا کنید. نکته: از قرار دادن لوله بعد از برچسب نهایی در پارامتر chxl خودداری کنید.

مثال ها

شرح مثال

این نمودار نحوه افزودن برچسب های سفارشی را به دو محور نشان می دهد. توجه داشته باشید که چگونه مقادیر به طور مساوی فاصله دارند، و چگونه آخرین مقدار chxl به یک لوله ختم نمی شود.

Line chart with 0 and 100 on the left, A, B, and C on the right, Jan,July, Jan, July, and Jan on the x-axis and 2005, 2006 and 2007 below
chxt=x,y
chxl=
0:|Jan|Feb|March|April|May|
1:|Min|Mid|Max

این مثال شامل برچسب های محور در محورهای y چپ و راست ( y و r ) است. همچنین شامل دو مجموعه از مقادیر برای محور x ( x ) است. می‌توانید با استفاده از chxs علامت‌هایی را روی محور y اضافه کنید.

Line chart with 0 and 100 on the left, A, B, and C on the right, Jan,July, Jan, July, and Jan on the x-axis and 2005, 2006 and 2007 below
chxt=x,y,r,x
chxl=
0:|Jan|July|Jan|July|Jan|
1:|0|50|100|
2:|A|B|C|
3:|2005|2006|2007

این مثال شامل برچسب های محور در محورهای y چپ و راست ( y و r ) است. همچنین شامل دو مجموعه از مقادیر برای محور x ( x ) است. به برچسب‌های خالی مجموعه محور x پایین‌تر توجه کنید که برای فاصله دادن مقادیر از هم استفاده می‌شود.

این مثال از مقادیر پیش فرض برای برچسب های محور در سمت چپ محور y استفاده می کند.

Bar chart with 0 and 100 on the left, A, B, and C on the right, Jan, July,Jan, July, and Jan on the x-axis and 2005, 2006 and 2007 below
chxt=x,y,r,x
chxl=
0:|Jan|July|Jan|July|Jan|
2:|A|B|C|
3:|2005||2006||2007

اگر می‌خواهید یک برچسب عمومی برای توصیف یک محور کامل اضافه کنید (مثلاً برای برچسب زدن یک محور "هزینه" و دیگری "دانشجو")، از ویژگی chxt برای اضافه کردن یک محور اضافی در هر طرف استفاده کنید، سپس از chxl برای اضافه کردن یک یک برچسب سفارشی برای هر طرف، و chxp برای فاصله آن در وسط محور.


chxt=x,x,y,y
chxl=1:|Martinis|3:|Score
chxp=1,50|3,50

بازگشت به بالا

موقعیت‌های برچسب محور chxp

می‌توانید تعیین کنید که کدام محورها نشان داده شوند، چه از برچسب‌های پیش‌فرض یا برچسب‌های سفارشی مشخص شده با استفاده از chxl استفاده کنید. اگر موقعیت‌های دقیق را با استفاده از این پارامتر مشخص نکنید، برچسب‌ها به طور مساوی و در یک مقدار گام پیش‌فرض در امتداد محورها قرار می‌گیرند. اگر chxl را مشخص نکنید، برچسب‌های علامت تیک مقادیر پیش‌فرض خواهند بود (معمولاً مقادیر داده‌ها یا اعداد میله‌ای در نمودارهای میله‌ای).

نحو

چندین مجموعه موقعیت یابی را با استفاده از کاراکتر لوله ( | ) جدا کنید.

chxp=
  <axis_1_index>,<label_1_position>,...,<label_n_position>
    |...|
  <axis_m_index>,<label_1_position>,...,<label_n_position>
<axis_index >
محوری که برای آن موقعیت ها را مشخص می کنید. این یک شاخص در آرایه پارامتر chxt است. به عنوان مثال، اگر chxt=x,x,y,y دارید، شاخص 0 اولین محور x، 1 دومین محور x و غیره خواهد بود.
< label_1_position >،...،< label_n_position >
موقعیت برچسب در امتداد محور. این یک لیست از مقادیر عددی جدا شده با کاما است، که در آن هر مقدار موقعیت برچسب مربوطه را در آرایه chxl تعیین می کند: اولین ورودی برای اولین برچسب اعمال می شود و غیره. موقعیت یک مقدار در محدوده آن محور است. توجه داشته باشید که این مقدار همیشه 0 تا 100 خواهد بود مگر اینکه یک محدوده سفارشی را با استفاده از chxr مشخص کرده باشید. شما باید به تعداد برچسب هایی که برای آن محور دارید موقعیت داشته باشید.

مثال ها

شرح مثال

این مثال شامل برچسب های محور r در موقعیت های مشخص شده در نمودار است. متن برچسب با استفاده از پارامتر chxl مشخص می شود.

برچسب هایی با موقعیت مشخص 0 ​​در پایین محور y یا r یا در سمت چپ محور x یا t قرار می گیرند.

برچسب هایی با موقعیت مشخص 100 در بالای محور y یا r یا در سمت راست محور x یا t قرار می گیرند.

Line chart with min, average, and max on the right, 20, 40, 60, 80, and 100 on the left, and 0, 25, 50, 75, and 100 along the x-axis
chxt=x,y,r
chxl=2:|min|average|max
chxp=2,10,35,75

این مثال نشان می دهد که مقادیر برچسب پیش فرض را نشان می دهد، اما فقط در مکان های مشخص شده.

chxp=1,10,35,75 - محور y باید فقط سه برچسب را نشان دهد: 10، 35، و 75. چون هیچ متن برچسب سفارشی مشخص نشده است، این مقادیر محور نشان داده می شوند. توجه داشته باشید که چگونه هنگام استفاده از chxp مجبور نیستید برچسب ها را به طور مساوی از هم جدا کنید. اگر chxp در اینجا مشخص نشده بود، فاصله مقدار برچسب پیش فرض در محور y هر 20 واحد خواهد بود، همانطور که در نمودار دوم نشان داده شده است.

Line chart with 10, 35, and 75 on the left, and 0, 25, 50, 75, and 100 along the x-axis
chxt=x,y
chxp=1,10,35,75

Line chart with default axis positions.
chxt=x,y
chxp مشخص نشده است

بازگشت به بالا

Axis Label Styles chxs

می توانید اندازه، رنگ و تراز قلم را برای برچسب های محور، هم برچسب های سفارشی و هم مقادیر برچسب پیش فرض تعیین کنید. همه برچسب ها در یک محور دارای قالب یکسانی هستند. اگر چندین نسخه از یک محور دارید، می‌توانید هر کدام را به‌طور متفاوتی قالب‌بندی کنید. همچنین می توانید قالب یک رشته برچسب را مشخص کنید، به عنوان مثال برای نشان دادن نمادهای ارز یا صفرهای انتهایی.

به طور پیش‌فرض، محورهای بالا و پایین علامت‌های تیک را با مقادیر نشان نمی‌دهند، در حالی که محورهای چپ و راست آن‌ها را نشان می‌دهند.

نحو

مقادیر برای چندین محور باید با استفاده از یک کاراکتر لوله ( | ) از هم جدا شوند.

chxs=
 <axis_index><opt_format_string>,<opt_label_color>,<opt_font_size>,<opt_alignment>,<opt_axis_or_tick>,<opt_tick_color>,<opt_axis_color>
   |...|
 <axis_index><opt_format_string>,<opt_label_color>,<opt_font_size>,<opt_alignment>,<opt_axis_or_tick>,<opt_tick_color>,<opt_axis_color>
< axis_index >
محوری که این امر در مورد آن صدق می کند. این یک شاخص مبتنی بر صفر در پارامتر chxt است.
< opt_format_string >
[ اختیاری ] این یک رشته فرمت اختیاری است که در صورت استفاده، بلافاصله پس از شماره شاخص محور بدون کاما می آید. با یک حرف N به معنای واقعی کلمه شروع می شود و مقادیر زیر را به دنبال دارد که همه اختیاری هستند: نحو رشته قالب بندی به شرح زیر است:
N< preceding_text >*< number_type >< decimal_places >zs< x or y >*< following_text >
در اینجا معنای هر عنصر وجود دارد:
  • <preceding_text> - متن تحت اللفظی برای قبل از هر مقدار.
  • *...* - بلوک اختیاری پیچیده شده در ستاره های تحت اللفظی، که در آن می توانید جزئیات قالب بندی اعداد را مشخص کنید. مقادیر زیر پشتیبانی می شوند و همه اختیاری هستند:
    • <number_type> - قالب عددی، برای مقادیر عددی. ‫ یکی از موارد زیر را انتخاب کنید:
      • f - [ پیش‌فرض ] قالب نقطه شناور. همچنین دقت را با مقدار < decimal_places > مشخص کنید.
      • p - فرمت درصد. علامت % به طور خودکار اضافه می شود. توجه: هنگام استفاده از این فرمت، مقادیر داده از 0.0 - 1.0 نقشه تا 0 - 100٪ (به عنوان مثال، 0.43 به عنوان 43٪ نشان داده می شود).
      • e - قالب نمادگذاری علمی.
      • c< CUR > - شماره را با ارز مشخص شده با نشانگر ارز مناسب فرمت کنید. < CUR > با یک کد ارز سه حرفی جایگزین کنید. مثال: cEUR برای یورو. شما می توانید لیستی از کدها را در وب سایت ISO پیدا کنید، اگرچه همه نمادها پشتیبانی نمی شوند.
    • <decimal_places> - یک عدد صحیح که مشخص می کند چند رقم اعشار باید نشان داده شود. مقدار به این طول گرد (نه کوتاه شده) است. پیش فرض 2 است.
    • z - نمایش صفرهای دنباله دار. پیش فرض خیر است .
    • s - نمایش جداکننده های گروه. پیش فرض خیر است .
    • x یا y -داده‌ها را از مختصات x یا y نمایش دهید، همانطور که مشخص شده است. معنای داده‌های x بر اساس نوع نمودار متفاوت است: نمودار خود را آزمایش کنید تا معنی آن را تعیین کنید. پیش فرض 'y' است .
  • < following_text > - متن تحت اللفظی برای دنبال کردن هر مقدار.
< opt_label_color >
رنگی که باید روی متن محور اعمال شود (اما نه خط محور)، در قالب هگزا دسیمال RRGGBB . رنگ خط محور به طور جداگانه با استفاده از opt_axis_color مشخص می شود. پیش فرض خاکستری است.
< opt_font_size >
[ اختیاری ] اندازه فونت را بر حسب پیکسل مشخص می کند. این پارامتر اختیاری است.
< opt_alignment >
[ اختیاری ] تراز برچسب. برای محورهای بالا یا پایین، این توضیح می دهد که چگونه برچسب با علامت تیک در بالا یا پایین آن تراز می شود. برای محورهای چپ یا راست، این توضیح می دهد که چگونه در داخل جعبه مرزی خود که محور را لمس می کند، تراز می شود. یکی از اعداد زیر را مشخص کنید:
  • -1 - بالا یا پایین : برچسب ها در سمت راست کنه ها قرار دارند. چپ یا راست : برچسب ها در ناحیه خود تراز چپ هستند. پیش‌فرض برای برچسب‌های محور r.
  • 0 - بالا یا پایین : برچسب ها روی کنه ها متمرکز می شوند. چپ یا راست : برچسب ها در مرکز منطقه خود قرار دارند. پیش‌فرض برای برچسب‌های محور x و t.
  • 1 - بالا یا پایین : برچسب ها در سمت چپ کنه ها قرار دارند. چپ یا راست : برچسب‌ها در ناحیه خود به سمت راست تراز می‌شوند. پیش‌فرض برای برچسب‌های محور y.
< opt_axis_or_tick >
[ اختیاری در Google-o-meter پشتیبانی نمی‌شود ] آیا علامت‌های تیک و/یا خطوط محور برای این محور نشان داده شود. علامت‌های تیک و خطوط محور فقط برای داخلی‌ترین محورها در دسترس هستند (مثلاً برای بیرونی دو محور x پشتیبانی نمی‌شوند). از یکی از مقادیر زیر استفاده کنید:
  • l (حروف کوچک "L") - فقط خط محور را رسم کنید.
  • t - فقط علامت های تیک را بکشید. علامت‌های تیک، خطوط کوچک کنار برچسب‌های محور هستند.
  • lt - [ پیش‌فرض ] هم یک خط محور بکشید و هم علامت‌هایی را برای همه برچسب‌ها علامت بزنید.
  • _ - (زیر خط) نه خط محور و نه علامت تیک بکشید. اگر می خواهید یک خط محور را پنهان کنید، از این مقدار استفاده کنید.
< tick_color >
[ اختیاری ; در Google-o-meter پشتیبانی نمی شود ] رنگ علامت تیک، در قالب هگزا دسیمال RRGBBB . پیش فرض خاکستری است.
< opt_axis_color >
[ اختیاری ] رنگ این خط محور، در قالب RRGGBB هگزادسیمال . پیش فرض خاکستری است.

مثال ها

شرح مثال

اندازه و رنگ فونت برای محور x دوم (ژان، فوریه، مارس) مشخص شده است.

Line chart with min, average, and max on the left, 0, 1, 2, 3, and 4 on the right, 0 to 100 along the x-axis and Jan, Feb, and Mar in blue below

chxt=x,y,r,x
chxr=2,0,4
chxl=3:|Jan|Feb|Mar|
1:|min|average|max
chxp=1,10,35,75
chxs=3,0000DD,13,0,t

اندازه قلم، رنگ و تراز برای محور y سمت راست مشخص شده است. علامت های تیک، اما بدون خط محور، ترسیم می شود.

Line chart with 0 to 100 along the x-axis, Jan, Feb, Mar below, 0 to 4 on the y-axis, and red tickmarks with blue text for min, average and max on the right.

chxt=x,y,r,x
chxl=3:|Jan|Feb|Mar|
2:|min|average|max
chxp=2,10,35,95
chxs=2,0000DD,13,-1,t,FF0000

این نمودار شامل سه مجموعه داده است و سه مجموعه از برچسب‌های محور را نشان می‌دهد، یکی در هر سری. هر مجموعه ای از برچسب ها با استفاده از یک رشته قالب بندی سفارشی قالب بندی می شوند، همانطور که در اینجا توضیح داده شده است:

  • 0N*e,000000|
    • 0 به معنای اولین سری داده است
    • N به معنای رشته قالب بندی است
    • * به معنای شروع مشخص کننده های قالب است
    • e به معنای نماد علمی است
    • * به معنای پایان مشخص کننده های قالب است
    • 000000 به معنی متن سیاه است.
  • 1N*cUSD*Mil,FF0000|
    • 1 یعنی سری دوم
    • N به معنای رشته قالب بندی است
    • * به معنای شروع مشخص کننده های قالب است
    • c به معنای نشانگر ارز است
    • USD دلار آمریکا را به عنوان نشانگر ارزی برای استفاده مشخص می کند
    • * به معنای پایان مشخص کننده های قالب است
    • Mil یک رشته تحت اللفظی است
    • FF0000 به معنای متن قرمز است.
  • 2N*sz2*,0000FF
    • 2 یعنی سری سوم
    • N به معنای رشته قالب بندی است
    • * به معنای شروع مشخص کننده های قالب است
    • s به معنای نشان دادن مشخص کننده های گروه بندی است (در زبان انگلیسی ایالات متحده، که هر سه صفر یک کاما است)
    • z2 به معنای نشان دادن دو صفر انتهایی است
    • 0000FF به معنای متن آبی است.

محدوده برچسب محور با استفاده از پارامتر chxr تنظیم می شود ( axis_index ، start ، end ، step ). اگر تنظیم نمی شد، آنها به طور پیش فرض 0-100 بودند.


chd=s:
984sttvuvkQIBLKNCAIi,
DEJPgq0uov17zwopQODS,
AFLPTXaflptx159gsDrn
chxr=
0,0,1000000,250000|
1,0,60|
2,0,5000
chxs=
0N*e,000000|
1N*cUSD*Mil,FF0000|
2N*sz2*,0000FF

بازگشت به بالا

Axis Tick Mark Styles chxtc

You can specify long tick marks for specific axes. Typically this is used to extend a tick mark across the length of a chart. Use the chxs parameter to change the tick mark color.

Values for multiple axes should be separated using a pipe character ( | ). Values within a series should be separated by a comma.

نحو

chxtc=
  <axis_index_1>,<tick_length_1>,...,<tick_length_n>
    |...|
  <axis_index_m>,<tick_length_1>,...,<tick_length_n>
< axis_index >
The axis to which this applies. This is a zero-based index into the chxt parameter. Separate values for different axes using a bar delimiter.
< tick_length_1 >,...,< tick_length_n >
Length of the tick marks on that axis, in pixels. If a single value is given, it will apply to all values; if more than one value is given, the axis tick marks will cycle through the list of values for that axis. Positive values are drawn outside the chart area and cropped by the chart borders. The maximum positive value is 25. Negative values are drawn inside the chart area and cropped by the chart area borders.

مثال ها

شرح مثال

Example of using chxtc to create long red tick marks. The tick mark length here exceeds the chart area width, but is cropped to fit within the chart.

  • chxt=x,y,r,x - Show a left axis, a right axis, and two bottom axes.
  • chxl =2:|min|average|max|3:|Jan|Feb|Mar - The label text assigned to the 'r' (right side) and outer x-axes.
  • chxp =2,10,35,95 - Custom label positions along the r-axis (index=2) for the three labels.
  • chxs=2,0000dd,13,-1,t,FF0000 - Axis label styles for the r-axis: text color, text size, left-aligned, with red tick marks.
  • chxtc=1,10|2,-180 - Axis tick lengths for the y- and r-axes. The first value specifies 10-pixel-long ticks, outside the axis. The second value specifies 180-pixel-long ticks inside the axis; the negative number means that the tick goes inside the axis, and the tick is cropped to fit inside the chart.

Line chart with 0 to 100 along the x-axis, Jan, Feb, Mar below, 0 to 4 on the y-axis, and long red tickmarks with blue text for min, average and max on the right.

chxt=x,y,r,x
chxl=
2:|min|average|max|
3:|Jan|Feb|Mar
chxp=2,10,35,95
chxs=
2,0000dd,13,-1,t,FF0000
chxtc=1,10|2,-180

This chart demonstrates alternating tick lengths. chxtc specifies two tick length values for the y-axis (5 and 15), and the ticks drawn on the chart alternate between the two values.
chxt=x,y
chxtc=
1,5,15

بازگشت به بالا

Background Fills chf [ All charts ]

You can specify fill colors and styles for the chart data area and/or the whole chart background. Fill types include solid fills, striped fills, and gradients. You can specify different fills for different areas (for example, the whole chart area, or just the data area). The chart area fill overwrites the background fill. All fills are specified using the chf parameter, and you can mix different fill types (solids, stripes, gradients) in the same chart by separating values with pipe character ( | ). Chart area fills overwrite chart background fills.

Solid Fills chf [ All Charts ]

You can specify a solid fill for the background and/or chart area, or assign a transparency value to the whole chart. You can specify multiple fills using the pipe character ( | ). (Maps: background only).

نحو

chf=<fill_type>,s,<color>|...
< fill_type >
The part of the chart being filled. Specify one of the following values:
  • bg - Background fill
  • c - Chart area fill. Not supported for map charts.
  • a - Make the whole chart (including backgrounds) transparent. The first six digits of < color > are ignored, and only the last two (the transparency value) are applied to the whole chart and all fills.
  • b <index> - Bar solid fills (bar charts only). Replace < index > with the series index of the bars to fill with a solid color. The effect is similar to specifying chco in a bar chart. See Bar Chart Series Colors for an example.
س
Indicates a solid or transparency fill.
< رنگ >
The fill color, in RRGGBB hexadecimal format . For transparencies, the first six digits are ignored, but must be included anyway.

مثال ها

شرح مثال

This example fills the chart background with pale gray ( EFEFEF ).

Red line chart with black area fill.

chf=bg,s,EFEFEF

This example fills the chart background with pale gray ( EFEFEF ) and fills the chart area in black ( 000000 ).

Red line chart with black chart area and pale gray background.

chf=c,s,000000|
bg,s,EFEFEF

This example applies a 50% transparency to the whole chart (80 in hexadecimal is 128, or about 50% transparency). Notice the table cell background showing through the chart.

Scatter plot with points in blue, and a 50% transparency.

chf=a,s,00000080

بازگشت به بالا

Gradient Fills chf [ Line, Bar, Google-o-meter, Radar, Scatter,Venn ]

You can apply one or more gradient fills to chart areas or backgrounds. Gradient fills are fades from a one color to another color. (Pie, Google-o-meter charts: background only.)

Each gradient fill specifies an angle, and then two or more colors anchored to a specified location. The color varies as it moves from one anchor to another. You must have at least two colors with different < color_centerpoint > values, so that one can fade into the other. Each additional gradient is specified by a < color >,< color_centerpoint > pair.

نحو

chf=<fill_type>,lg,<angle>,<color_1>,<color_centerpoint_1>
    ,...,
  <color_n>,<color_centerpoint_n>
< fill_type >
The chart area to fill. One of the following:
  • bg - Background fill
  • c - Chart area fill.
  • b <index> - Bar gradient fills (bar charts only). Replace < index > with the series index of the bars to fill with a gradient. See Bar Chart Series Colors for an example.
lg
Specifies a gradient fill.
< angle >
A number specifying the angle of the gradient from 0 (horizontal) to 90 (vertical).
< رنگ >
The color of the fill, in RRGGBB hexadecimal format .
< color_centerpoint >
Specifies the anchor point for the color. The color will start to fade from this point as it approaches another anchor. The value range is from 0.0 (bottom or left edge) to 1.0 (top or right edge), tilted at the angle specified by < angle >.

مثال ها

شرح مثال

Chart area has a horizontal linear gradient, specified with an angle of zero degrees ( 0 ).

The colors are peach ( FFE7C6 ), centered on the left side (position 0.0 ) and blue ( 76A4FB ) centered on the right side (position 1.0 ).

The chart background is drawn in gray ( EFEFEF ).

Dark gray line chart with pale gray background and chart area in a white to blue linear gradient from left to right

chf=
c,lg,0,
FFE7C6,0,
(peach)
76A4FB,1
(blue)

Chart area has a diagonal (bottom left to top right) linear gradient, specified with an angle of forty-five degrees ( 45 ).

Peach ( FFE7C6 ) is the first color specified. The bottom left of the chart is pure peach.

Blue ( 6A4FB ) is the second color specified. The top right of the chart is pure blue. Note how we specify an offset of 0.75, to provide a peak of blue that fades away towards the top right corner.

The chart background is drawn in gray ( EFEFEF ).

Dark gray line chart with pale gray background and chart area in a white to blue diagonal linear gradient from bottom left to top right

chf=
c,lg,45,
FFE7C6,0,
(peach)
76A4FB,0.75
(blue)

Chart area has a vertical (top to bottom) linear gradient, specified with an angle of ninety degrees ( 90 ).

Blue ( 76A4FB ) is the first color specified. The top of the chart is pure blue.

Peach ( FFE7C6 ) is the second color specified. The bottom of the chart is pure peach.

The chart background is drawn in gray ( EFEFEF ).

Dark gray line chart with pale gray background and chart area in a white to blue vertical linear gradient from bottom to top

chf=
c,lg,90,
FFE7C6,0,
(peach)
76A4FB,0.5
(blue)

بازگشت به بالا

Striped fills chf [ Line, Bar, Google-o-meter, Radar, Scatter, Venn ]

You can specify a striped background fill for your chart area, or the whole chart. (Pie, Google-o-meter charts: background only.)

نحو

chf=
  <fill_type>,ls,<angle>,<color_1>,<width_1>
    ,...,
  <color_n>,<width_n>
< fill_type >
The chart area to fill. One of the following:
  • bg - Background fill
  • c - Chart area fill
  • b <index> - Bar striped fills (bar charts only). Replace < index > with the series index of the bars to fill with stripes. See Bar Chart Series Colors for an example.
ls
Specifies linear stripe fill.
< angle >
The angle of all stripes, relative to the y-axis. Use 0 for vertical stripes or 90 for horizontal stripes.
< رنگ >
The color for this stripe, in RRGGBB hexadecimal format . Repeat < color > and < width > for each additional stripe. You must have at least two stripes. Stripes alternate until the chart is filled.
< width >
The width of this stripe, from 0 to 1 , where 1 is the full width of the chart. Stripes are repeated until the chart is filled. Repeat < color > and < width > for each additional stripe. You must have at least two stripes. Stripes alternate until the chart is filled.

مثال ها

شرح مثال
  • bg,ls,0 - Background stripe fill with stripes at a zero degree angle to the y-axis (parallel to the y-axis). The stripes fill the chart background as well as the plot area.
  • CCCCCC,0.15 - The first stripe is dark gray, 15% as wide as the chart.
  • FFFFFF,0.1 - The second stripe is white, 10% as wide as the chart.
Blue line chart with alternating gray and white stripes from left to right
chf=
bg,ls,0,
CCCCCC,0.15,
FFFFFF,0.1
  • c,ls,90 - Chart area with horizontal stripes at an angle of ninety degrees from the y-axis. The stripes fill the plot area, but the chart background is omitted.
  • 999999,0.25 - The first stripe is dark gray, 25% as wide as the chart.
  • CCCCCC,0.25 - Same as the first stripe, but a lighter gray.
  • FFFFFF,0.25 - Same as the first stripe, but white.
Blue line chart with a dark gray, pale gray, white and dark gray stripes from bottom to top
chf=
c,ls,90,
999999,0.25,
CCCCCC,0.25,
FFFFFF,0.25

بازگشت به بالا

Grid Lines chg [ Line, Bar, Radar, Scatter ]

You can specify solid or dotted grid lines on your chart using the chg parameter.

This parameter doesn't let you specify the thickness or color of the lines. For more ways to make lines across your chart, see shape markers ( chm type h, H, v, or V), range markers ( chm ), and axis tick marks ( chxtc ).

نحو

chg=
  <x_axis_step_size>,<y_axis_step_size>,<opt_dash_length>,<opt_space_length>,<opt_x_offset>,<opt_y_offset>
< x_axis_step_size >, < y_axis_step_size >
Used to calculate how many x or y grid lines to show on the chart. 100 / step_size = how many grid lines on the chart. So: 20,25 would mean 5 vertical grid lines and 4 horizontal grid lines.
< opt_dash_length >, < opt_space_length >
[ Optional ] Used to define dashed grid lines. The first parameter is the length of each line dash, in pixels. The second parameter is the spacing between dashes, in pixels. Specify 0 for < opt_space_length> for a solid line. Default values are 4,1.
< opt_x_offset >,< opt_y_offset >
[ Optional ] The number of units, according to the chart scale, to offset the x and y grid lines, respectively. Can be positive or negative values. If you specify this value, you must also specify all preceding values. Default values are 0,0.

مثال ها

شرح مثال

These examples use only the < x_axis_step_size > and < y_axis_step_size > parameters. The Chart API displays a dashed grid line by default.

Line chart with 5 vertical and two horizontal pale gray dashed grid lines
chg=20,50
Line chart with 5 vertical and two horizontal pale gray dashed grid lines
chg=20,50

This example uses larger spaces to display lighter grid lines ( 1,5 ).

Line chart with 5 vertical and two horizontal faint, pale gray, dashed grid lines
chg=20,50,1,5

To display solid grid lines, specify zero ( 0 ) for the < opt_space_length > parameter.

This chart also specifies an x-axis offset of 10.

Line chart with 5 vertical and two horizontal pale gray, solid grid lines
chg=20,50,1,0,10

This chart demonstrates an x-axis offset of 10, and ay axis offset of 20.

Line chart with 5 vertical and two horizontal pale gray, solid grid lines
chg=20,50,3,3,10,20

بازگشت به بالا

Line Styles chls [ Line, Radar ]

You can specify line thickness and solid/dashed style with the chls parameter. This parameter can only be used to style lines in line or radar charts; you cannot use it to style the line in a compound chart lines, unless the base type of the compound chart is a line chart.

نحو

Separate multiple line styles by the pipe character ( | ); the first style applies to the first line, the second to the next, and so on. If you have fewer styles than lines, the default style is applied to all the unspecified lines.

chls=
  <line_1_thickness>,<opt_dash_length>,<opt_space_length>
    |...|
  <line_n_thickness>,<opt_dash_length>,<opt_space_length>
< line_1_thickness >
Thickness of the line, in pixels.
< opt_dash_length >, < opt_space_length >
[ Optional ] Used to define dashed grid lines. The first parameter is the length of each line dash, in pixels. The second parameter is the spacing between dashes, in pixels. For a solid line, specify neither value. If you only specify < opt_dash_length >, then < opt_space_length > will be set to < opt_dash_length >. Default is 1,0 (a solid line ).

مثال ها

شرح مثال

Here the dashed line is specified by 3,6,3 and the thicker, solid line is specified by 5 ..

Line chart with one solid line and one dashed line
chls=3,6,3|5

بازگشت به بالا

Dynamic Icon Markers chem [ Bar, Line, Radar, Scatter ]

Create your chart, and specify one or more dynamic icons as chem values. The syntax of chem is as follows. All semicolon-delimited items in purple are optional, and any one can be omitted entirely in your URL. You can include multiple markers by including multiple syntax strings delimited by a | شخصیت. You can read more about dynamic icons on the dynamic icon page .

You can also embed a chart inside another chart as a dynamic icon. See the Embedded Charts subsection below.

chem=
  y;s=<icon_string_constant>;d=<marker_data_string>;ds=<which_series>;dp=<which_points>;py=<opt_z_order>;po=<x,y>;of=<x_offset,y_offset>
|...| y;s=<icon_string_constant>;d=<marker_data_string>;ds=<which_series>;dp=<which_points>;py=<opt_z_order>;po=<x,y>;of=<x_offset,y_offset>
s=< icon_string_constant >
A string marker constant for a dynamic icon, from the dynamic icon page . This constant is almost the same as the chst parameter for freestanding icons. But where the freestanding icon string starts with "d_", you should remove that prefix to get the equivalent dynamic icon marker. Example: freestanding icon: d_bubble_icon_text_small ; equivalent dynamic icon marker: bubble_icon_text_small .
d=< marker_data_string >
The data required for this particular marker type. This holds the same string that would be used in a chld parameter for an equivalent freestanding icon, except that all | delimiters should be replaced by commas (remember to use commas instead of pipe markers for multiline text!). Note that within the data string, you must also escape the following characters with a @ mark: pipe ( | ) , at ( @ ) , equals ( = ), comma ( , ), semicolon ( ; ). Examples: hello@,+world , 5@@10+cents+each .
ds=< which_series >
[ Optional ] The zero-based index of the data series that this marker belongs to. Default value is 0.
dp=< which_points >
[ Optional ] Specifies which data points are used to draw markers. Default value is 0 (first point in the series) . Use one of the following formats:
  • nd - Which data point to draw the marker on, where nd is the zero-based index in the series. اگر یک مقدار غیر صحیح را مشخص کنید، آن کسری یک نقطه میانی محاسبه شده را نشان می دهد. مثلاً 3.5 به معنای نیمه راه بین نقطه 3 و 4 است.
  • range,< start >,< end >,< step > - Draw a marker on every step data point in a range from start to end , inclusive. start and end are index values, and can be floating point numbers to indicate intermediate values. All values are optional; defaults are: start=0, end=last item, step=1. If you skip a value, you must still include any intermediate commas, but you don't have to include empty trailing commas. Examples: dp=range,0,4 draws a marker on elements 0 through 4; dp=range,5,10,2 draws a marker on elements 5, 7, and 9; dp=range,2 draws points on the third point and later; dp=range,3,,1.5 draws markers on every 1.5 data points from the fourth item to the last.
  • all - Draw a marker on every element. This is equivalent to range,0, end_index . Example: dp=all
  • every,n - Draw a marker on every n th marker. Example: dp=every,2 draws a marker on items 0, 2, and 4.
py=< z_order >
[ اختیاری ] لایه ای که روی آن نشانگر کشیده می شود، در مقایسه با سایر نشانگرها و سایر عناصر نمودار. این یک عدد ممیز شناور از -1.0 تا 1.0 است، که در آن -1.0 پایین و 1.0 بالا است. Chart elements (lines and bars) are just below zero. اگر دو نشانگر مقدار یکسانی داشته باشند، به ترتیب نشان داده شده توسط URL رسم می شوند. مقدار پیش فرض 0.0 است (درست بالای عناصر نمودار).
po=< x,y >
[ Optional ] An absolute position on the chart at which to draw the marker. x and y are two floating point numbers, where 0.0,0.0 is the bottom left corner and 1.0,1.0 is the top right corner.
of=< x_offset,y_offset >
[ Optional ] A number of pixels to offset the icon from its normal position. x_offset and y_offset are positive or negative integers. It is important to specify this value in an embedded dynamic icon, because the marker will be centered vertically and horizontally over the point, which means that the point probably won't line up with the data marker. A good offset for an upright pin is of=0,22 ; a good offset for a slanted pin is either of=-12,20 or of=12,20 depending on the direction of the slant, but you might have to experiment. Default value is 0,0.

مثال ها

شرح مثال
Here are examples of the same dynamic icon created as a free-standing image, and used as a marker in a line chart.

Chart 1: https://chart.googleapis.com/chart?chs=300x140&cht=lc&chco=FF9900,224499&
chd=t:75,74,66,30,10,5,3,1&chls=1|1&
chem=y;s=bubble_icon_text_small;d=ski,bb,Wheeee!,FFFFFF;dp=2;ds=0&chm=v,ccccFF,0,::.2,2

Chart 2: https://chart.googleapis.com/chart?chst=d_bubble_icon_text_small&chld=ski|bb|Wheeee!|FFFFFF|000000

Line chart with dynamic icon marker.
chem=
y;s=bubble_icon_text_small;d=ski,bb,Wheeee!,FFFFFF;dp=2;ds=0


Same dynamic icon marker as standalone image.


chst=
d_bubble_icon_text_small
chld=
ski|bb|Wheeee!|FFFFFF|000000

Note that a dynamic icon marker will be centered on the point horizontally and vertically. So if you use a dynamic icon with a tail, the tail won't be on the chart point; the marker center will be. The first chart centers the mark on data point 3, which actually puts the tail a bit to the right of the mark on the line.

The second chart uses the of value to move the tail of the marker on top of the desired data point. A good offset for a slanted pin is -12,20.


chem=y;
s=map_xpin_letter;
d=pin_sleft,A,FF0000;
dp=3;
ds=1



chem=y;
s=map_xpin_letter;
d=pin_sleft,A,FF0000;
dp=3;
ds=1;
of=-12,0

To include multiple dynamic icons, repeat the syntax string, delimited by a | شخصیت.

This example shows a range, as well as two individual markers.

Note how the vertical pins are offset by of 0,22, and the slanted pin has an offset of 12,20 to make the pin points line up with the series that they describe.


chem=
y;s=map_xpin_letter;d=pin_sright,A,FF0000;dp=4;ds=0;py=1;of=12,20|
y;s=map_pin_icon;d=baby,FF5555;ds=1;dp=6;of=0,22|
y;s=map_pin_icon;d=camping,DEF763;ds=2;dp=range,2,5
This demonstrates a multiline text marker. The marker must be offset after adding the text, because the bubble resizes to fit the text, causing it to be re-centered on the chart. Note how newlines in the text are indicated by commas in the d data string.
chem=y;
s=bubble_texts_big;
d=bbbr,FFC6A5,000000,Outlier,Forgot+to+feed;
ds=0;
dp=13;
of=-120,2

نمودارهای جاسازی شده

You can embed one chart inside another using the dynamic icon syntax.

There are two styles of embedded chart markers: embedded charts in a bubble, and embedded charts with no bubble. Here are examples of both:

Bubble-less chart
Chart with bubble
Chart without bubble

Here are the specifics of the s=< icon_string_constant >;d=< marker_data_string > parameters, both for non-bubble and bubble-embedded charts (parameters covered above aren't described again here):

نحو

Non-bubble:
  chem=y;s=ec;d=<alignment_string>,<chart_data>;ds=<which_series>;dp=<which_points>;py=<z_order>;po=<x,y>;of=<x_offset,y_offset>

Bubble:
  chem=y;s=ecb;d=<frame_type>,<padding>,<frame_color>,<fill_color>,<chart_data>;ds=<which_series>;dp=<which_points>;py=<z_order>;po=<x,y>;of=<x_offset,y_offset>
alignment_string
[ Non-bubble only ] Which part of the bubble-less embedded chart is pinned to the data point. Choose one of the two-letter string constants in the following diagram: Alignment strings
chart_data
The data for the embedded chart. This is everything after https://chart.googleapis.com/chart? in the URL of the chart to embed. Use the tool below, or follow the rules listed below the tool.
frame_type
[ Bubble only ] One of the dynamic icon frame style constants .
padding
[ Bubble only ] Padding inside the bubble, in pixels.
frame_color
[ Bubble only ] Color of the frame, as a six-digit HTML color string without the # mark. Example: FF00FF .
fill_color
[ Bubble only ] Bubble fill color, as a six-digit HTML color string without the # mark. Example: FF00FF .

Embedded chart data

Use the following conversion tool to help generate your chart string, or else generate the chart string manually following the rules given after the tool.

Rules for manual conversion

1. First replace all the following characters in the parameter and value pairs with the following values, in the order shown:

Replace With this
%7C or %7c
|
@
@@
%
%25
،
@,
|
@|
;
@;
&
%26
=
%3D

2. Then replace all the & and = values in the parameter1=value1&parameter2=value2... pairs with commas.

بازگشت به بالا

Line Fills chm [ Line, Radar ]

You can fill the area below a data line with a solid color.

You can combine line fills with any other chm parameters using a pipe character ( | ) to separate the chm parameters.

نحو

chm=
  <b_or_B>,<color>,<start_line_index>,<end_line_index>,<0>
    |...|
  <b_or_B>,<color>,<start_line_index>,<end_line_index>,<0>
< b_or_B >
Whether to fill to the bottom of the chart, or just to the next lower line.
  • B - Fill from < start_line_index > to the bottom of the chart. < end_line_index > supports a special syntax to let you fill a segment of the chart. This is easiest if you have a chart with a single line that you want to fill.
  • b - Fill between two lines in a multi-line chart. Start and end lines are indicated by < start_line_index > and < end_line_index > .
< رنگ >
An RRGGBB format hexadecimal number of the fill color.
< start_line_index >
The index of the line at which the fill starts. The first data series specified in chd has an index of zero ( 0 ), the second data series has an index of 1 , and so on.
< end_line_index >
  • Fill type 'b' - The line at which to stop the fill. This line must be below the current line.
  • Fill type 'B' - One of the following choices:
    • any value - Any single number in this parameter is ignored, and the fill will go from the specified line to the base of the chart
    • start:end - To fill a vertical slice below the chart, specify start:end , where these are data point indices describing where to start and stop the fill. Both values are optional, and default to first_point : last_point . (See example below.)
<0>
Reserved — must be zero.

مثال ها

شرح مثال

For a single series, it is simplest to use chm=B . This fills the entire area under the line.

This is the only fill area type available for radar charts. chm=b does not work with radar charts.


chm=B,76A4FB,0,0,0

Here's a chart with two lines and two fills. Filling the area below the bottom line and above the top line requires a special technique, covered next.


chd=s:
cefhjkqwrlgYcfgc,
QSSVXXdkfZUMRTUQ,
HJJMOOUbVPKDHKLH,

chm=
b,224499,0,1,0| (blue)
b,FF0000,1,2,0| (red)

In a multi-line chart, to fill from the top of the chart to the first line, include a series that contains two copies of the highest data value for the data format. So, for example, " .... " for extended encoding, " 100,100 " for basic text format, and so on. Fill from this series to the topmost line.

To fill from the last line to the bottom of the chart, include a series that contains two copies of the lowest data value for the data format. So, for example, AAAA for extended encoding, 0,0 for basic text format, and so on.

The lines themselves are drawn in black, using chco .

Three lines on a chart; chart is shaded in green from bottom to first line, red from first to second line, dark blue from second to third line and pale blue from third line to top of the chart
chd=e:
....,
(highest value)
cefhjkqwrlgYcfgc,
QSSVXXdkfZUMRTUQ,
HJJMOOUbVPKDHKLH,
AAAA
(zero value)
chm=
b,76A4FB,0,1,0|
(light blue)
b,224499,1,2,0| (blue)
b,FF0000,2,3,0| (red)
b,80C65A,3,4,0 (green)
chco=000000

Here is a line chart with vertical fill slices. This is accomplished by specifying a start : end pair for < end_line_index > with line fill type 'B'.

  • B,76A4FB,0,0:3,0 - Blue vertical fill under line 0, bound by data points 0—3.
  • B,990000,0,7:10,0 - Red vertical fill under line 0, bound by data points 7—10.
  • B,DEDC06,0,12:,0 - Yellow vertical fill under line 0, from data point 12 through the end of the series.

chm=
B,76A4FB,0,0:3,0|
B,990000,0,7:10,0|
B,DEDC06,0,12:,0

This example shows using a line fill on a radar chart.

Radar chart
chm=
B,FF000080,0,1.0,5.0|
B,FF990080,1,1.0,5.0

بازگشت به بالا

نشانگرهای شکل chm [ نوار، خط، رادار، پراکندگی ]

شما می توانید نشانگرهای گرافیکی را برای تمام یا تک نقاط داده در نمودار مشخص کنید. اگر دو یا چند نشانگر یک نقطه را اشغال کنند، نشانگرها به ترتیبی که در پارامتر chm ظاهر می شوند رسم می شوند. همچنین می توانید نشانگرهای متنی را در نقاط داده ایجاد کنید که در نشانگرهای نقطه داده پوشش داده شده است.

می توانید نشانگرهای شکل را با هر پارامتر chm دیگری با استفاده از یک کاراکتر لوله ( | ) ترکیب کنید تا پارامترهای chm را جدا کنید.

نحو

برای هر سری که باید علامت گذاری شوند، یک مجموعه از پارامترهای زیر را مشخص کنید. برای علامت‌گذاری چند سری، مجموعه‌های پارامتر اضافی ایجاد کنید که با یک کاراکتر لوله مشخص شده‌اند. لازم نیست همه سری ها را علامت گذاری کنید. If you do not assign markers to a data series, it will not get any markers.

نشانگرهای شکل در نمودارهای پراکندگی کمی متفاوت عمل می کنند. برای اطلاعات بیشتر به آن مستندات مراجعه کنید.

chm=
  [@]<marker_type>,<color>,<series_index>,<opt_which_points>,<size>,<opt_z_order>,<opt_offset>
    |...|
  [@]<marker_type>,<color>,<series_index>,<opt_which_points>,<size>,<opt_z_order>,<opt_offset>
@
[ اختیاری ] اگر قبل از نوع نشانگر با کاراکتر اختیاری @ قرار دهید، < opt_which_points > باید از قالب x:y استفاده کند.
<marker_type>
نوع نشانگر مورد استفاده یکی از انواع زیر را مشخص کنید:
  • a - پیکان
  • c - صلیب
  • C - مستطیل. اگر نشانگر مستطیلی باشد، باید حداقل دو سری داده داشته باشید، که سری 0 لبه پایینی و سری 1 لبه بالایی را مشخص می کند. < size > عرض مستطیل را بر حسب پیکسل مشخص می کند.
  • d - الماس
  • E - نشانگر نوار خطا ( ) این نشانگر برای ایجاد به دو سری داده نیاز دارد، یک مقدار برای پایین و نقطه مربوطه در سری دوم برای بالا. همچنین یک < size > syntax توسعه یافته: line_thickness [: top_and_bottom_width ] که در آن top_and_bottom_width اختیاری است را نشان می دهد. نمونه های زیر را ببینید.
  • h - خط افقی در عرض نمودار در ارتفاع مشخص. ( تنها قالب معتبر برای پارامتر < opt_which_points > nd است. )
  • H - خط افقی از طریق نشانگر داده مشخص شده. این از یک نحو توسعه یافته < size > پشتیبانی می کند که به شما امکان می دهد طول خط دقیقی را مشخص کنید: line_thickness [: length ] که در آن : length اختیاری است و به طور پیش فرض در عرض منطقه نمودار کامل است.
  • o - دایره
  • s - مربع
  • v - خط عمودی از محور x تا نقطه داده
  • V - خط عمودی با طول قابل تنظیم. این از یک نحو توسعه یافته < size > مقدار پشتیبانی می کند که به شما امکان می دهد طول خط دقیقی را تعیین کنید: line_thickness [: length ] که در آن : length اختیاری است و به طور پیش فرض ارتفاع منطقه کامل نمودار را تعیین می کند. نشانگر بر روی نقطه داده متمرکز شده است.
  • x - یک X
< رنگ >
رنگ نشانگرهای این سری، با فرمت هگزادسیمال RRGGBB .
< series_index >
شاخص مبتنی بر صفر سری داده که نشانگرها را بر روی آن رسم می کند. برای نشانگرهای h و نشانگرهایی که مکان را با موقعیت x/y مشخص می‌کنند نادیده گرفته می‌شود (با نویسه @ شروع کنید). می توانید از سری داده های پنهان به عنوان منبعی برای نشانگرها استفاده کنید. برای اطلاعات بیشتر به نمودارهای مرکب مراجعه کنید. نمودارهای میله‌ای عمودی گروه‌بندی‌شده از یک نحو توسعه‌یافته ویژه برای تراز کردن نشانگرها با میله‌های خاص پشتیبانی می‌کنند.
< opt_which_points >
[ اختیاری ] روی کدام نقطه (نقاط) باید نشانگرها را بکشیم. پیش فرض همه نشانگرها است. از یکی از مقادیر زیر استفاده کنید:
  • nd - کجا نشانگر را بکشیم. معنی بستگی به نوع نشانگر دارد:
    • همه انواع به جز h - نشانگر روی کدام نقطه داده رسم شود، جایی که nd شاخص مبتنی بر صفر در سری است. اگر یک مقدار غیر صحیح را مشخص کنید، آن کسری یک نقطه میانی محاسبه شده را نشان می دهد. مثلاً 3.5 به معنای نیمه راه بین نقطه 3 و 4 است.
    • h - عددی از 0.0 تا 1.0 که 0.0 پایین نمودار و 1.0 بالای نمودار است.
  • -1 - روی تمام نقاط داده یک نشانگر بکشید. همچنین می توانید این پارامتر را خالی بگذارید تا روی تمام نقاط داده ترسیم شود.
  • - n - روی هر n -مین نقطه داده یک نشانگر رسم کنید. مقدار ممیز شناور؛ اگر n کمتر از 1 باشد نمودار امتیازات واسطه اضافی را برای شما محاسبه می کند. به عنوان مثال، 0.5- دو برابر بیشتر از نقاط داده نشانگر قرار می دهد.
  • start:end:n - روی هر n- امین نقطه داده در یک محدوده، از مقادیر شاخص شروع تا پایان ، یک نشانگر بکشید. همه پارامترها اختیاری هستند (ممکن است وجود نداشته باشند)، بنابراین 3::1 از عنصر چهارم تا آخرین عنصر، مرحله 1 خواهد بود، و حذف کامل این پارامتر به صورت پیش فرض اولین : آخرین : 1 خواهد بود. همه مقادیر می توانند اعداد ممیز شناور باشند. شروع و پایان می تواند منفی باشد تا از آخرین مقدار به عقب شمارش شود. اگر هر دو شروع و پایان منفی هستند، مطمئن شوید که در مقدار افزایشی فهرست شده اند (مثلاً -6:-1:1). اگر مقدار n مرحله کمتر از 1 باشد، نقاط داده اضافی را با درون یابی مقادیر داده شده محاسبه می کند. مقادیر پیش فرض first:last:1 هستند
  • x : y - یک نشانگر در یک نقطه x/y مشخص روی نمودار بکشید. این نقطه نباید روی یک خط باشد. برای استفاده از این گزینه، کاراکتر @ را قبل از نوع نشانگر اضافه کنید. مختصات را به عنوان مقادیر ممیز شناور مشخص کنید، جایی که 0:0 گوشه پایین سمت چپ نمودار و 1:1 گوشه سمت راست بالای نمودار است. به عنوان مثال، برای افزودن یک الماس قرمز 15 پیکسلی به مرکز نمودار، از @d,FF0000,0,0.5:0.5,15 استفاده کنید.
< اندازه >
اندازه نشانگر، بر حسب پیکسل. اکثراً یک مقدار واحد برای این پارامتر می گیرند. نشانگرهای V، H و S از نحو < اندازه >[: عرض ] پشتیبانی می کنند که در آن قسمت دوم اختیاری طول خط یا نشانگر را مشخص می کند.
< opt_z_order >
[ اختیاری ] لایه ای که روی آن نشانگر کشیده می شود، در مقایسه با سایر نشانگرها و سایر عناصر نمودار. این یک عدد ممیز شناور از -1.0 تا 1.0 است، که در آن -1.0 پایین و 1.0 بالا است. عناصر نمودار (خطوط و میله ها) فقط کمتر از صفر هستند. اگر دو نشانگر مقدار یکسانی داشته باشند، به ترتیب نشان داده شده توسط URL رسم می شوند. مقدار پیش فرض 0.0 است (درست بالای عناصر نمودار).
< opt_offset >
[ اختیاری ] به شما اجازه می دهد که افست های افقی و عمودی را از مکان مشخص شده مشخص کنید. در اینجا نحوی وجود دارد که از یک : جداکننده: reserved :< horizontal_offset >:< vertical_offset > استفاده می کند. در صورت مشخص شدن، می توانید یک مقدار خالی،، را در رشته پارامتر chm برای < opt_z_order > وارد کنید. مثال‌ها: o,FF9900,0,4,12,, :10 o,FF9900,0,4,12.0,, :-10:20 o,FF9900,0,4,12,1, ::20
  • رزرو شده - خالی بگذارید.
  • < horizontal_offset > - یک عدد مثبت یا منفی که افست افقی را بر حسب پیکسل مشخص می کند. اختیاری؛ در صورت عدم استفاده، خالی بگذارید.
  • < vertical_offset > - یک عدد مثبت یا منفی که افست عمودی را بر حسب پیکسل مشخص می کند. اختیاری؛ در صورت عدم استفاده، خالی بگذارید.

مثال ها

شرح مثال

در اینجا مثالی از چندین نشانگر شکل و خط آورده شده است.

  • a,990066,0,0.0,9.0 - پیکان بنفش سری اول نقطه اول سایز 9.
  • c,FF0000,0,1.0,20.0 - صلیب سرخ سری اول نقطه دوم سایز 9.
  • d,80C65A,0,2,20.0 - الماس سبز سری اول نقطه سوم سایز 9.
  • H,000000,0,3,1:40 - خط افقی سیاه، سری اول، نقطه داده 3، عرض یک پیکسل، طول چهل پیکسل.
  • o,FF9900,0,4.0,12.0 - دایره نارنجی سری اول نقطه پنجم سایز 12.
  • s,3399CC,0,5.0,11.0 - مربع آبی سری اول نقطه ششم سایز 11.
  • v,BBCCED,0,6.0,1.0 - خط عمودی تا نقطه، سری اول، نقطه هفتم، عرض یک پیکسل.
  • V,3399CC,0,7.0,1.0 - خط عمودی از پایین به بالای نمودار، سری اول، نقطه هشتم، عرض یک پیکسل.
  • x,FFCC33,0,8.0,20.0 - زرد 'X' سری اول امتیاز نهم سایز 20.
  • H,FFFF00,0,9,2 - خط زرد افقی به عرض نمودار در نقطه داده 9.
  • h,FF0000,0,0.5,1 - خط افقی قرمز رنگ در ارتفاع مشخص شده، سری اول، نیمه راه نمودار، عرض یک پیکسل.
Line chart with markers
chm=
a,990066,0,0.0,9.0|
c,FF0000,0,1.0,20|
d,80C65A,0,2.0,20.0|
H,000000,0,3,1:40|
o,FF9900,0,4.0,12.0|
s,3399CC,0,5.0,11.0|
v,BBCCED,0,6,1.0|
V,3399CC,0,7,1.0|
x,FFCC33,0,8,20|
H,FFFF00,0,9,2|
h,FF0000,0,0.5,1

در اینجا مثالی برای استفاده از الماس برای یک سری داده و دایره برای سری داده دیگر آورده شده است.

اگر دو یا چند نشانگر یک نقطه را اشغال کنند، نشانگرها به ترتیبی که در پارامتر chm ظاهر می شوند رسم می شوند. در اینجا، دایره اولین نشانگری است که با chm مشخص شده است، بنابراین ابتدا ترسیم می شود. الماس در مرحله دوم مشخص و ترسیم می شود که منجر به کشیدن آن در بالای دایره می شود.

Line chart, one line has 15 pixel circles on each data point the other line has 10 pixel diamonds. A diamond is drawn on the point that is common to both lines
chm=
o,FF9900,0,-1,15.0|
d,FF0000,1,-1,10.0

در اینجا یک نمودار خطی با یک نشانگر در هر نقطه داده دوم وجود دارد (-2 به معنای هر نقطه دیگر).

Line chart with marker on every second point
chd=t:
0,20,20,50,40,70,70,90,85,45,40,50
chm=
o,0066FF,0,-2,6
در اینجا یک نمودار خطی با دو برابر بیشتر از نقاط داده (0.5- به معنای هر نیم نقطه) وجود دارد. Line chart with marker on every second point
chd=t:
0,20,20,50,40,70,70,90,85,45,40,50
chm=
o,0066FF,0,-.5,6
این مثال نحوه استفاده از نشانگرهای h و v را برای ایجاد خطوط شبکه با رنگ‌ها و ضخامت سفارشی نشان می‌دهد. مقدار z-order (آخرین مقدار) روی -1 تنظیم شده است تا خطوط شبکه زیر خط داده رسم شوند.
Line chart with marker on every second point
chm=
h,76A4FB,0,0:1:.2,2,-1|
V,76A4FB,0,::2,0.5,-1

این نمودار خطوط پر عمودی را به نمودار خطی اضافه می کند:

  • v - خطوط عمودی به نمودار
  • FF0000 - خطوط قرمز
  • 0 - شاخص سری
  • : :.5 - تعیین کننده محدوده: از ابتدا تا انتها، هر 0.5 امتیاز.
  • 2 - ضخامت 2 پیکسل.
Line chart with marker on every second point
chm=
v,FF0000,0,::.5,2
این مثال با استفاده از مختصات دقیق یک فلش و نشانگر متن را به نمودار اضافه می کند. اولین نشانگر D خط ردیابی زیر میله ها است. نشانگر دوم فلش است و نشانگر سوم متن پیکان است.
chm=
D,003971,1,0,3|
@a,000000,0,.25:.75,7|
@tExpected,000000,0,.35:.85,10
یک خط افقی ثابت در یک نقطه داده خاص ( H ) می تواند برای نشان دادن مقادیر نسبی یا تأکید بر ارتفاع یک مقدار داده در نمودار مفید باشد.
chm=H,FF0000,0,18,1

این نمودار نشانگرهایی را نشان می دهد که می توانند ضخامت و طول خط را در پارامتر < size > مشخص کنند.

  • E,000000,0,6,1:20 - نوار خطای سیاه با خطوط گسترده 1 پیکسلی، نوارهای بالا و پایین به طول 20 پیکسل. قسمت پایین به سری 0 نقطه 8 و قسمت بالا به سری 1 نقطه 8 متصل می شود.
  • H,990066,1,2,5:50 - بنفش، خط افقی پنج پیکسل عرض، پنجاه پیکسل طول در مرکز نقطه داده 2.
  • V,3399CC,0,8,3:50 - آبی، خط عمودی به عرض 3 پیکسل، پنجاه پیکسل طول، در مرکز نقطه داده 8.
title="cht=lc&chd=s:2gounjqLaCf,jqLaCf2goun&chco=008000,00008033&chls=2.0,4.0,1.0&chs=250x150&chm=H,990066,1,2,7CCCV:5,39% 7CE,000000,0,6,1:20" src="/chart/image/images/chart_95.png" />
chm=
E,000000,0,6,1:20|
H,990066,1,2,5:50|
V,3399CC,0,8,3:50

بازگشت به بالا

Text and Data Value Markers chm [ Bar, Line, Radar, Scatter ]

You can label specific points on your chart with custom text, or with formatted versions of the data at that point.

You can combine any chm markers using a pipe character ( | ) to separate the chm parameter sets.

A note on string values: Only URL-safe characters are permitted in label strings. To be safe, you should URL-encode any strings containing characters not in the character set 0-9a-zA-Z . You can find a URL encoder in the Google Visualization Documentation .

نحو

برای هر سری که باید علامت گذاری شوند، یک مجموعه از پارامترهای زیر را مشخص کنید. برای علامت‌گذاری چند سری، مجموعه‌های پارامتر اضافی ایجاد کنید که با یک کاراکتر لوله مشخص شده‌اند. لازم نیست همه سری ها را علامت گذاری کنید. If you do not assign markers to a data series, it will not get any markers.

chm=
  <marker_type>,<color>,<series_index>,<opt_which_points>,<size>,<opt_z_order>,<opt_placement>
    |...|
  <marker_type>,<color>,<series_index>,<opt_which_points>,<size>,<opt_z_order>,<opt_placement>
<marker_type>
نوع نشانگر مورد استفاده You can choose from the following types:
  • f<text> - A flag containing text. Specify the character 'f', followed by custom URL-encoded text. To escape commas in text markers, precede the comma by a \ mark. Example: fHello\,+World!
  • t<text> - A simple text marker. Specify the character 't' followed by custom URL-encoded text. To escape commas in text markers, precede the comma by a \ mark. Example: tHello\,+World!
  • A< text > - An annotation marker. This is similar to a flag marker, but markers will coordinate their position so that they do not overlap. The only valid format for < opt_which_points > is nd , to signify the index of a point in the series.
  • N< formatting_string > - The value of the data at this point, with optional formatting. If you do not use the chds parameter (custom scaling) it gives the exact encoded value; if you do use that parameter with any format type the value will be scaled to the range that you specify. See an example of chds with numeric markers below. With this marker type in a stacked bar chart , if you specify -1 for < series_index > you will get a marker that shows the sum of all values in this stacked bar. The formatting string syntax is as follows:
    < preceding_text >*< number_type >< decimal_places >zs< x or y >*< following_text > .
    All of these elements are optional. Here is the meaning of each element:
    • <preceding_text> - Text to precede each value.
    • *...* - An optional block wrapped in literal asterisks, in which you can specify formatting details for numbers. The following values are supported, and are all optional:
      • <number_type> - The number format, for numeric values. Choose one of the following:
        • f - [ Default ] Floating point format. Consider specifying precision as well with the < decimal_places > value.
        • p - Percentage format. A % sign is appended automatically. Note: When using this format, data values from 0.0 — 1.0 map to 0 — 100% (for example, 0.43 will be shown as 43%).
        • e - Scientific notation format.
        • c< CUR > - Format the number in the currency specified, with the appropriate currency marker. Replace < CUR > with a three-letter currency code. Example: cEUR for Euros. You can find a list of codes on the ISO web site , although not all symbols are supported.
      • <decimal_places> - An integer specifying how many decimal places to show. The value is rounded (not truncated) to this length. Default is 2.
      • z - Display trailing zeros. Default is no .
      • s - Display group separators. Default is no .
      • x or y -Display the data from the x- or y-coordinate, as specified. The meaning of x data varies by chart type: experiment with your chart to determine what it means. Default is 'y' .
    • < following_text > - Text to follow each value.
< رنگ >
The color of the markers for this set, in RRGGBB hexadecimal format .
< series_index >
شاخص مبتنی بر صفر سری داده که نشانگرها را بر روی آن رسم می کند. If this is a stacked bar chart and the marker type is N (data point values), you can specify -1 to create a summed value marker for each stack of bars. برای مثال زیر را ببینید.
< opt_which_points >
[ اختیاری ] روی کدام نقطه (نقاط) باید نشانگرها را بکشیم. پیش فرض همه نشانگرها است. از یکی از مقادیر زیر استفاده کنید:
  • nd - Which data point to draw the marker on, where nd is the zero-based index in the series. اگر یک مقدار غیر صحیح را مشخص کنید، آن کسری یک نقطه میانی محاسبه شده را نشان می دهد. مثلاً 3.5 به معنای نیمه راه بین نقطه 3 و 4 است.
  • -1 - روی تمام نقاط داده یک نشانگر بکشید. همچنین می توانید این پارامتر را خالی بگذارید تا روی تمام نقاط داده ترسیم شود.
  • -n - Draw a marker on every n -th data point.
  • start : end : n - Draw a marker on every n -th data point in a range, from start to end index values, inclusive. همه پارامترها اختیاری هستند (ممکن است وجود نداشته باشند)، بنابراین 3::1 از عنصر چهارم تا آخرین عنصر، مرحله 1 خواهد بود، و حذف کامل این پارامتر به صورت پیش فرض اولین : آخرین : 1 خواهد بود. همه مقادیر می توانند اعداد ممیز شناور باشند. شروع و پایان می تواند منفی باشد تا از آخرین مقدار به عقب شمارش شود. اگر هر دو شروع و پایان منفی هستند، مطمئن شوید که در مقدار افزایشی فهرست شده اند (مثلاً -6:-1:1). اگر مقدار n مرحله کمتر از 1 باشد، نقاط داده اضافی را با درون یابی مقادیر داده شده محاسبه می کند. مقادیر پیش فرض first:last:1 هستند
  • x : y - [ Not supported for N-type markers ] Draw a marker at a specific x/y point on the chart. این نقطه نباید روی یک خط باشد. Add the at character ( @ ) before the marker type to use this option. Specify the coordinates as floating point values, where 0:0 is the bottom left corner of the chart, 0.5:0.5 is the center of the chart, and 1:1 is the top right corner of the chart. به عنوان مثال، برای افزودن یک الماس قرمز 15 پیکسلی به مرکز نمودار، از @d,FF0000,0,0.5:0.5,15 استفاده کنید.
< اندازه >
The size of the marker in pixels. If this is a scatter chart with a third data series (used to specify point sizes), this value will be scaled by the data range. So if the data range is 0—100 and < size > is 30, a data value of 100 would be 30 pixels wide, a data value of 50 would be 15 pixels wide, and so on.
< opt_z_order >
[ اختیاری ] لایه ای که روی آن نشانگر کشیده می شود، در مقایسه با سایر نشانگرها و سایر عناصر نمودار. این یک عدد ممیز شناور از -1.0 تا 1.0 است، که در آن -1.0 پایین و 1.0 بالا است. عناصر نمودار (خطوط و میله ها) فقط کمتر از صفر هستند. اگر دو نشانگر مقدار یکسانی داشته باشند، به ترتیب نشان داده شده توسط URL رسم می شوند. Default value is 0.0 (just above the chart elements).
< opt_placement >
[ Optional ] Additional placement details describing where to put this marker, in relation to the data point. You can specify horizontal and/or vertical relative positioning, as well as offsets. Placement syntax is a string with : delimiters as shown here. All elements are optional: < horizontal_and_vertical_justification >:< horizontal_offset >:< vertical_offset > . در صورت مشخص شدن، می توانید یک مقدار خالی،، را در رشته پارامتر chm برای < opt_z_order > وارد کنید. Examples: N,000000,0,1,10,,b and N,000000,0,1,10,,lv and N,000000,0,1,10,,r::10 .
horizontal_and_vertical_justification
The anchor point of the marker. This behaves opposite to justification, so a left anchor actually puts the marker to the right of the data point. You can choose a horizontal and/or vertical justifier from the following list:
  • Horizontal placement : 'l', 'h', or 'r' - Left, center, or right-anchored, horizontally. Default is 'l'.
  • Vertical placement : 'b', 'v', 't' - Bottom, middle, or top-anchored, vertically. Default is 'b'.
  • Bar-relative placement [ Bar charts only] : 's', 'c', 'e' - Base, center, or top of a bar. For stacked charts, this is relative to the section of the bar for each series, not for the whole bar. If the series index given is -1 (stack total) it is in relation to the whole bar. This can be combined with vertical placement values: for example, 'be' or 'vs'. Default value is 'e'.
horizontal_offset
A horizontal offset for this marker, in pixels. Default is 0.
vertical_offset
A vertical offset for this marker, in pixels. Non-bar chart default: 15; bar chart chart default: 2 .

شرح مثال

Here's an example of value labels on a bar chart.

The first chart ( N*p0* ) specifies a data value marker, with values shown as a percentage, rounded to zero decimal places, in black, on all values, in 11-point text. Note that the data values are all between 0.0 and 1.0, which, in percentage format, are moved up two decimal places.

The second chart ( N*cEUR1* ) shows the same values formatted as Euro values, one decimal place, in black, on all values, in 11-point text.

Bar chart with percentage labels above each bar
chm=
N*p0*,000000,0,-1,11
chd=t:
0.4356,0.3562,0.4834,0.575,0.673,0.6091


Bar chart with Euro labels above each bar


chm=
N*cEUR1*,000000,0,-1,11

You can use the chds parameter to scale the numeric value displayed. You can use chds for all data formats, including simple and extended encoding. This will not affect the bar size or the axis labels, but only the data marker value.

This example shows a chart with simple-encoded values of 46, 39, 29, 30, 43, 41. Simple encoding range is 0—61 . The chds parameter defines a custom marker scale of 0—1, so marker values are scaled to this range, but the bar heights are not affected (if this were text format data , the bars would be scaled as well).


chd=s:underp
chm=N,000000,0,-1,11
chds=0,1

Here's an example of a chart with a text label at the minimum point and a flag label at the maximum point.

Line chart with 10pt blue text label, and flag with 15pt red text, drawn on the data points of a dashed green line.
chm=
tMin,0000FF,0,1,10|
fMax,FF0000,0,3,15

This example shows a stacked chart with values for individual series, plus the series total. To show the stacked series values, we must use the 'c' positioning option; if we did not, the top bar value would overlap the sum value at the top of each bar.
chm=
N,FF0000,-1,,12|
N,000000,0,,12,,c|
N,000000,1,,12,,c|
N,ffffff,2,,12,,c
Some more demonstrations of how vertical and horizontal placement work. This example demonstrates various combinations of anchor values for bar charts (which use s, c,and e for vertical placement). Note how a right anchor moves a marker left, and a top anchor moves a marker down, and vice-versa. The red dots show the base, center, and top of each bar. The number is the data value, fixed using different anchor values for each bar.
chm=
N,000000,0,0,10,,rs
N,000000,0,1,10,,ls
N,000000,0,2,10,,c
N,000000,0,3,10,,e
N,000000,0,4,10,,e::15
N,000000,0,5,10,,e::-12
Annotation markers automatically adjust the label position so that they don't overlap. The first chm value is for the line fill, the following values are all annotation markers.
chm=B,C5D4B5BB,0,0,0
AA,666666,0,3,15
AB,666666,0,5,15
AC,666666,0,24,15
AD,666666,0,25,15
AE,666666,0,26,15
AF,666666,0,51,15
AG,666666,0,60,15
AH,666666,0,73,15
AI,666666,0,80,15
AJ,666666,0,99,15
Another annotation marker example demonstrating city altitudes in Switzerland.

بازگشت به بالا

Range Markers chm [ Bar, Candlestick, Line, Radar, Scatter ]

You can color horizontal or vertical bands of background fill to highlight specific areas of a chart.

You can combine any chm markers using a pipe character ( | ) to separate the chm parameter sets.

نحو

Specify one set of the following parameters for each band to draw. To draw multiple bands, create additional parameter sets, delimited by a pipe character. Ranges are drawn in the order specified, so the last range drawn will be drawn on top of previous ranges.

chm=
  <direction>,<color>,0,<start_point>,<end_point>
    |...|
  <direction>,<color>,0,<start_point>,<end_point>
<direction>
Specifies horizontal or vertical shading. Use r for a horizontal range and R for a vertical range.
< رنگ >
The range color as an RRGGBB format hexadecimal number .
0
Reserved — must be zero.
< start_point >
The start position of the range.
  • For horizontal range markers, this is a position on the y-axis, where 0.00 is the bottom of the chart, and 1.00 is the top of the chart.
  • For vertical range markers, this is a position on the x-axis, where 0.00 is the left of the chart, and 1.00 is the right of the chart.
< end_point >
The end position of the range.
  • For horizontal range markers, this is a position on the y-axis, where 0.00 is the bottom of the chart, and 1.00 is the top of the chart.
  • For vertical range markers, this is a position on the x-axis, where 0.00 is the left of the chart, and 1.00 is the right of the chart.

مثال ها

شرح مثال

Range markers can be a thin line or a band of color.

  • r,E5ECF9,0,0.75,0.25 - Range marker, pale blue, (reserved), 0.5 of the height of the chart.
  • r,000000,0,0.1,0.11 - Range marker, black, (reserved), starts at 0.1 of the way up the y-axis and ends at 0.11 of the way up the y-axis (a thin black line).
Line chart with a pale blue horizontal band stretching from 25 percent to 75 percent of the way up the y-axis and a thin horizontal line ten percent of the way up the y-axis
chm=
r,E5ECF9,0,0.75,0.25|
r,000000,0,0.1,0.11

This example shows the vertical range markers. The first marker is a red line ( FF0000 ), and the second is a pale blue band ( A0BAE9 ).

Line chart with a pale blue vertical band stretching from 25 percent to 75 percent of the way along the x-axis and a thin vertical line ten percent of the way along the x-axis
chm=
R,FF0000,0,0.1,0.11|
R,A0BAE9,0,0.75,0.25

Markers are drawn in the order specified. In this example, you can see that the vertical red marker was drawn before the pale blue horizontal marker.

Line chart with a blue vertical band and paler blue horizontal band stretching from 25 percent to 75 percent of the way along the x and y-axis respectively. Thin vertical red line and thin horizontal black line ten percent of the way along the x and y-axis respectively
chm=
R,FF0000,0,0.1,0.11|
R,A0BAE9,0,0.75,0.25|
r,E5ECF9,0,0.75,0.25|
r,000000,0,0.1,0.11

Here's an example of a line chart that uses range markers to draw faint horizontal lines across the chart at the zero line, midpoint line, and top.

Sparkline with single yellow line and three equally spaced horizontal lines
chm=
r,000000,0,0.499,0.501|
r,000000,0,0.998,1.0|
r,000000,0,0.0,0.002

بازگشت به بالا

نشانگرهای خط chm=D [ نوار، کندل، خط، رادار، پراکندگی ]

می توانید خطی اضافه کنید که داده ها را در نمودار شما ردیابی می کند. اغلب، این در نمودارهای ترکیبی استفاده می شود.

برای افزودن چندین خط (یا ترکیب آن با هر نشانگر chm دیگری)، مجموعه پارامترهای chm را با استفاده از یک جداکننده لوله ( | ) جدا کنید. با این پارامتر نمی توانید یک نشانگر خط چین بسازید.

نحو

chm=
  D,<color>,<series_index>,<which_points>,<width>,<opt_z_order>
دی
نشان می دهد که این یک نشانگر خط است.
< رنگ >
رنگ خط، در قالب هگزادسیمال RRGGBB .
< series_index >
شاخص سری داده ای که برای ترسیم خط استفاده می شود. شاخص سری داده برای سری داده اول 0 ، برای سری داده دوم 1 و غیره است.
< which_points >
از کدام نقاط در یک سری برای رسم خط استفاده کنیم. از یکی از مقادیر زیر استفاده کنید:
  • 0 - از تمام نکات سری استفاده کنید.
  • start:end - از محدوده مشخصی از نقاط در سری، از ابتدا تا انتها ، شامل (شاخص مبتنی بر صفر) استفاده کنید. همچنین می توانید از مقادیر ممیز شناور برای تعیین نقاط میانی استفاده کنید یا شروع یا پایان را به ترتیب برای نشان دادن اولین یا آخرین نقطه داده خالی بگذارید. شروع و پایان می تواند منفی باشد، به عنوان یک شاخص معکوس از آخرین مقدار. اگر هر دو شروع و پایان منفی هستند، حتما آنها را با مقدار افزایشی بنویسید (مثلاً -6:-1).
< اندازه >
عرض خط بر حسب پیکسل
< opt_z_order >
[ اختیاری ] لایه ای که روی آن نشانگر کشیده می شود، در مقایسه با سایر نشانگرها و سایر عناصر نمودار. این یک عدد ممیز شناور از -1.0 تا 1.0 است، که در آن -1.0 پایین و 1.0 بالا است. عناصر نمودار (خطوط و میله ها) فقط کمتر از صفر هستند. اگر دو نشانگر مقدار یکسانی داشته باشند، به ترتیب نشان داده شده توسط URL رسم می شوند. مقدار پیش فرض 0.0 است (درست بالای عناصر نمودار).

مثال ها

شرح مثال

این نمونه ای از رسم یک خط نشانگر روی نمودار میله ای است. ترتیب z روی 1 تنظیم شده است، بنابراین خط در بالای میله ها کشیده می شود.

این مثال از داده های یکسانی هم برای میله ها و هم برای خط داده استفاده می کند.
Bar chart with line marker
chm=D,0033FF,0,0,5,1
chd=s:1XQbnf4

این همان نمودار میله ای است، اما با یک سری داده اضافی فقط برای خط. این نمونه ای از نمودار ترکیبی است. نمودارهای مرکب با افزودن سری داده های اضافی به پارامتر chd ، به علاوه یک مقدار برای chd ترسیم می شوند که به نمودار می گوید سری داده های اضافی را "نادیده بگیرد".

برای اطلاعات بیشتر به نمودارهای مرکب مراجعه کنید.

Bar chart with line marker
chm=D,0033FF,1,0,5,1
chd=s1:1XQbnf4,43ksfg6

بازگشت به بالا

Data Functions chfd [ All chd charts ]

You can specify a custom function to run over chart data using muParser function syntax . The data used in the function can come from one of two sources:

  • A data series from chd - The data is pulled from the specified series in chd .
  • A range of values declared in the chfd parameter itself - You declare a start, stop, and step value for an arbitrary data range.

It is important to note that in all cases you must assign the output to an existing series in chd ; that series will be overwritten by the function output. The chart is rendered only after all functions have been processes, so if you assign multiple functions to output to the same data series, the functions will be run in the order given, but only the output of the final function will be plotted on the chart. Note that you can chain functions, so that one function can take as input a series that was output by a previous function.

To assign colors or chm markers to a function line, assign the colors or markers to the function's series index. Note that markers are placed according to the data after it has been manipulated by the function.

نحو

chfd=
  <output_series_index>,<function_data>,<function_string>
    |...|
  <output_series_index>,<function_data>,<function_string>
< output_series_index >
Zero-based index of a data series in chd to which the function output will be written. Any existing data will be completely overwritten by the function output. If a series is not being used as input for a function, best practice is to assign a single dummy value to that series.
< function_data >
The variables and data to plot. The data can be from a range that you define, or from one of the chd data series. You can specify multiple variables for each function, using a ; (semicolon) delimiter for multiple variables. Note that if you define multiple variables for a single function, and these variables have a different number of points, the function will stop when it reaches the first endpoint. For example, if a function defines both x=1—5 step 1 and y=1—10 step 1, the function will end when it reaches the fifth point.
< variable_name >,< input_series_index >
OR
< variable_name >,< start >,< end >,< step >
  • variable_name - An arbitrary string name for the variable. Use this in the function defined by function_string .
  • input_series_index - The index of a chd data series to use as input data.
  • start - The numeric start value of a range.
  • end - The numeric end value of a range.
  • step - The numeric step value from start to end . Can be positive or negative, but cannot be zero.
Examples: x,0,100,1 declares a variable named x with values 0, 1, 2, ... 100. x,0,100,1;r,0,3.1,.1 declares the same x variable plus a variable named r with values 0, 0.1, 0.2, ..., 3.0, 3.1. x,0 declares a variable named x that uses the data from the first chd series. These variables will be used by function_string . They will not be plotted on the graph unless you specify them in function_string . The smaller the step, the smoother your graph.
< function_string >
Your function, written in the muParser syntax . The function is applied to the variables and data specified in variable_data . You can only reference the variables declared in this local function set, not in another piped set of chfd parameters. Summary muParser functions are not supported (min, max sum, avg). IMPORTANT: Remember to use %2B instead of + in your functions!

مثال ها

شرح مثال

A simple sine wave. Some things to notice:

  • chd=t:-1 - We use a dummy variable for the chart data, because our data is declared in the chfd parameter.
  • chco=FF0000 - Red is specified for the first series. Even though we don't use the data from chd , the corresponding color for that series will be used for that plotted function.
  • chfd=0,x,0,11,0.1,sin(x)*50%2B50 - We declare one variable, called x, with values 0—11, incremented by 0.1. It is assigned to the first series, which means it will get the first series color (FF0000). The function applied to x is sin(x) * 50 + 50. Note how we must encode the + in that function.

Sine wave specified by chfd
cht=lc
chd=t:-1
chco=FF0000
chfd=
0,x,0,11,0.1,sin(x)*50%2B50
chxt=x,y
This line uses data from the chd parameter.
chd=t:5,10
chfd=0,x,0,x*4

A mix of function and non-function lines.

Notice how the colors are specified by the series color parameter chco .

Notice the placement of markers on the function output; the data points are calculated from start , end , and step , so if your range is 0—11 step 0.1, point 0 is 0, point 1 is 0.1 and so on, until point 110, which has a value of 11.

One series using chfd, one using chd for its data.
chd=t:
-1
15,45
chco=
FF0000,000000
chfd=
0,x,0,11,0.1,sin(x)*50%2B50
chm=
c,00A5C6,0,110,10
a,00A5C6,0,60,10

To define a function in two dimensions, use an lxy chart, assign two dummy series, and assign a function to each.

  • 0,x,0,10,0.1,sin(x)*50%2B50 - Series 0 (the x-axis values) has a variable named x, with values from 0—10, step 0.1, and a function sin(x)*50 + 50
  • 0,y,0,10,0.1,sin(y)*50%2B50 - Series 0 (the y-axis values) has a variable named y, with values from 0—10, step 0.1, and a function sin(x)*50 + 50
A circle
cht=lxy
chd=t:-1|-1
chfd=
0,x,0,10,0.1,sin(x)*50%2B50|
1,y,0,10,0.1,cos(y)*50%2B50

The chfd parameter can really let you express your creativity.

Try clicking these images to open and play with them in the chart playground; you'll get hooked!



بازگشت به بالا