Jump to content




ChartsAPI

api lua utility

7 replies to this topic

Poll: ChartsAPI

What do you think about this API?

You cannot see the results of the poll until you have voted. Please login and cast your vote to see the results of this poll.
Vote Guests cannot vote

#1 Checco2212

  • Members
  • 59 posts
  • LocationSomewhere in Europe

Posted 25 March 2016 - 02:05 PM

ChartsAPI

By Checco2212

Create charts easly!


What is ChartsAPI?

Is an API created to help you creating good looking OS and programs full of datas


How to initialise the API?

os.loadAPI("DIRECTORY/charts")


How to use this API?

After initializing the API you only need to write

charts.functionName(variables)


Function list

charts.lineType(title,xPos,yPos,lenght,Val,maxVal,letter,bgLetter,datavis)


It will create a line chart with indicated characters.

Examples

Spoiler


charts.lineColor(title,xPos,yPos,lenght,Val,maxVal,color,bgColor,datavis)


It will create a line chart with indicated colors.

Esamples

Spoiler


charts.square(title,xPos,yPos,wid,hei,val,maxVal,letter,color,bgColor)


It will create a square chart with indicated characters, if the character is " " it will automatically create a color chart.

Esamples

Spoiler


charts.tableLines(xPos,yPos,inputTable,columnsName,title,titlepos)


It will create a columns charts with the input table.

The input table shuld be like this: inputTable={10,16,17,13,21}


Esamples

Spoiler


charts.tableAxed(xPos,yPos,inputTable,title,titlepos)


It will create an xy charts with the input table.

The input table shuld be like this: inputTable={10,16,17,13,21}


Esamples

Spoiler


tableAxedC(xPos,yPos,inputTable,textColor,bgColor,pointColor,connectionColor,title,titlepos)


It will create an xy charts with the input table.

The input table shuld be like this: inputTable={10,16,17,13,21}


Esamples

Spoiler


How can I download this API?




Type

pastebin get 8xiKc9U9 /charts

in your computer


Changelog
Spoiler


‚ÄčThis API is constantly growing so, help me adding more awesome features in the next versions by posting ideas and tips! Thanks!

[b][size=5]Found any bug or error? Reply to this post

Edited by Checco2212, 15 July 2016 - 10:32 AM.


#2 mrpew

  • New Members
  • 2 posts

Posted 16 April 2016 - 04:43 PM

Does not work, attempt to call nil using copy+paste'd example code:
table = {4,6,8,10,12}
charts.tableLines("",3,3,table,0)


#3 moTechPlz

  • Members
  • 40 posts

Posted 16 April 2016 - 06:46 PM

He should not have used 'table' as a variable in the example. Try this;
tTest = { 4, 6, 8, 10, 12 }
charts.tableLines( "", 3, 3, tTest, 0 )

Edited by moTechPlz, 16 April 2016 - 06:52 PM.


#4 mrpew

  • New Members
  • 2 posts

Posted 16 April 2016 - 11:44 PM

Nope, table is not a lua keyword, that was not the problem, he declared that function as local. I would have edited that into my post but it was not approved at that point.

#5 Lupus590

  • Members
  • 1,982 posts
  • LocationUK

Posted 17 April 2016 - 01:20 PM

View Postmrpew, on 16 April 2016 - 11:44 PM, said:

table is not a lua keyword

true, but it is an api which gets used a lot in the background when you're handling tables

Edited by Lupus590, 17 April 2016 - 01:21 PM.


#6 Checco2212

  • Members
  • 59 posts
  • LocationSomewhere in Europe

Posted 10 June 2016 - 10:10 PM

Now online: ChartsAPI 1.1
Write comments about what should I add in the next version :)

Edited by Checco2212, 11 June 2016 - 09:28 AM.


#7 unnamedcoder

  • Members
  • 23 posts

Posted 11 June 2016 - 10:17 PM

View PostmoTechPlz, on 16 April 2016 - 06:46 PM, said:

He should not have used 'table' as a variable in the example. Try this;
tTest = { 4, 6, 8, 10, 12 }
charts.tableLines( "", 3, 3, tTest, 0 )

The following keywords are reserved and cannot be used as names: and, break, do, else, elseif, end, false, for, function, if, in, local, nil, not, or, in, local, nil, not,or, repeat, return, then, true, until, while.


#8 Checco2212

  • Members
  • 59 posts
  • LocationSomewhere in Europe

Posted 14 June 2016 - 12:14 PM

View Postunnamedcoder, on 11 June 2016 - 10:17 PM, said:

View PostmoTechPlz, on 16 April 2016 - 06:46 PM, said:

He should not have used 'table' as a variable in the example. Try this;
tTest = { 4, 6, 8, 10, 12 }
charts.tableLines( "", 3, 3, tTest, 0 )


The following keywords are reserved and cannot be used as names: and, break, do, else, elseif, end, false, for, function, if, in, local, nil, not, or, in, local, nil, not,or, repeat, return, then, true, until, while.


I've just modified the post with your suggestion





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users